diff --git a/functions.php b/functions.php index 0857891..3ad9d65 100644 --- a/functions.php +++ b/functions.php @@ -3,6 +3,14 @@ if ( !defined( 'WPINC' ) ) { die; } +function minimalistflex_load_textdomain() { + load_theme_textdomain( 'minimalistflex', get_template_directory() . '/languages' ); +} + +add_action( 'init', 'minimalistflex_load_textdomain' ); + +require_once 'includes/customizer.php'; + function minimalistflex_add_supports() { add_theme_support( 'custom-background', Array( 'default-position-x' => 'center', @@ -15,7 +23,9 @@ function minimalistflex_add_supports() { add_theme_support( 'automatic-feed-links' ); add_theme_support( "align-wide" ); add_theme_support( "post-thumbnails" ); - add_theme_support( 'html5', Array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'style', 'script', 'navigation-widgets' ) ); + if ( !(function_exists( 'classicpress_version' ) && version_compare( classicpress_version(), '2.0.0', '>=' )) ) { + add_theme_support( 'html5', Array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'style', 'script', 'navigation-widgets' ) ); + } add_theme_support( 'custom-logo', Array( 'width' => '80', 'height' => '80' @@ -129,16 +139,13 @@ function minimalistflex_register_menus() { add_action( 'init', 'minimalistflex_register_menus' ); function minimalistflex_dynamic_css() { + require_once 'includes/color-definitions.php'; require_once 'includes/colors.php'; require_once 'includes/languages.php'; } add_action( 'wp_footer', 'minimalistflex_dynamic_css' ); -load_theme_textdomain( 'minimalistflex', get_template_directory() . '/languages' ); - -require_once 'includes/customizer.php'; - function minimalistflex_custom_excerpt_length() { return intval( get_theme_mod( 'minimalistflex_interface_excerpt', '55' ) ); } diff --git a/includes/color-definitions.php b/includes/color-definitions.php index 2c77bf4..60b7d46 100644 --- a/includes/color-definitions.php +++ b/includes/color-definitions.php @@ -25,43 +25,43 @@ $colors = Array( ); $labels = Array( - 'level1' => __( 'Content Background', 'minimalistflex' ), - 'level2' => __( 'Sidebar Background', 'minimalistflex' ), - 'level3-dark' => __( 'Secondary Text', 'minimalistflex' ), - 'default' => __( 'Default', 'minimalistflex' ), - 'link' => __( 'Link', 'minimalistflex' ), - 'link-hover' => __( 'Link Hover', 'minimalistflex' ), - 'tint' => __( 'Tint A', 'minimalistflex' ), - 'tint-dark' => __( 'Tint A Dark', 'minimalistflex' ), - 'tint-alt' => __( 'Tint B', 'minimalistflex' ), - 'tint-contrast' => __( 'Tint C', 'minimalistflex' ), - 'contrast' => __( 'Contrast (Light)', 'minimalistflex' ), - 'contrast-dark' => __( 'Contrast (Dark)', 'minimalistflex' ), - 'footer-text' => __( 'Footer Text', 'minimalistflex' ), - 'footer-bg' => __( 'Footer Background', 'minimalistflex' ), - 'header-bg' => __( 'Header Background', 'minimalistflex' ), - 'header-menu' => __( 'Navigation Menu Background', 'minimalistflex' ), - 'header-sidebar' => __( 'Navigation Menu Submenu Background', 'minimalistflex' ), - 'header-text' => __( 'Navigation Menu', 'minimalistflex' ) + 'level1' => esc_html__( 'Content Background', 'minimalistflex' ), + 'level2' => esc_html__( 'Sidebar Background', 'minimalistflex' ), + 'level3-dark' => esc_html__( 'Secondary Text', 'minimalistflex' ), + 'default' => esc_html__( 'Default', 'minimalistflex' ), + 'link' => esc_html__( 'Link', 'minimalistflex' ), + 'link-hover' => esc_html__( 'Link Hover', 'minimalistflex' ), + 'tint' => esc_html__( 'Tint A', 'minimalistflex' ), + 'tint-dark' => esc_html__( 'Tint A Dark', 'minimalistflex' ), + 'tint-alt' => esc_html__( 'Tint B', 'minimalistflex' ), + 'tint-contrast' => esc_html__( 'Tint C', 'minimalistflex' ), + 'contrast' => esc_html__( 'Contrast (Light)', 'minimalistflex' ), + 'contrast-dark' => esc_html__( 'Contrast (Dark)', 'minimalistflex' ), + 'footer-text' => esc_html__( 'Footer Text', 'minimalistflex' ), + 'footer-bg' => esc_html__( 'Footer Background', 'minimalistflex' ), + 'header-bg' => esc_html__( 'Header Background', 'minimalistflex' ), + 'header-menu' => esc_html__( 'Navigation Menu Background', 'minimalistflex' ), + 'header-sidebar' => esc_html__( 'Navigation Menu Submenu Background', 'minimalistflex' ), + 'header-text' => esc_html__( 'Navigation Menu', 'minimalistflex' ) ); $desciprtions = Array( - 'level1' => __( 'The background color of the main content area.', 'minimalistflex' ), - 'level2' => __( 'The background color of the sidebar.', 'minimalistflex' ), - 'level3-dark' => __( 'The secondary text color. Should be lighter than the default color.', 'minimalistflex' ), - 'default' => __( 'The default text color.', 'minimalistflex' ), - 'link' => __( 'The link color.', 'minimalistflex' ), - 'link-hover' => __( 'The link color when hovered.', 'minimalistflex' ), - 'tint' => __( 'Tint color A. Should be a light color.', 'minimalistflex' ), - 'tint-dark' => __( 'A darker variant of the tint color A. Only used on the scroll bars.', 'minimalistflex' ), - 'tint-alt' => __( 'Tint color B. Should be a dark color.', 'minimalistflex' ), - 'tint-contrast' => __( 'Tint color C. Should be a *even darker* color.', 'minimalistflex' ), - 'contrast' => __( 'Text color on a light background. Better keep it as is.', 'minimalistflex' ), - 'contrast-dark' => __( 'Text color on a dark background. Better keep it as is.', 'minimalistflex' ), - 'footer-text' => __( 'The footer text color.', 'minimalistflex' ), - 'footer-bg' => __( 'The footer background color.', 'minimalistflex' ), - 'header-bg' => __( 'The background color of the header.', 'minimalistflex' ), - 'header-menu' => __( 'The background color of the navigation menu dropdown.', 'minimalistflex' ), - 'header-sidebar' => __( 'The background color of the submenus of the navigation menu dropdown.', 'minimalistflex' ), - 'header-text' => __( 'The text color of the navigation menu dropdown.', 'minimalistflex' ) + 'level1' => esc_html__( 'The background color of the main content area.', 'minimalistflex' ), + 'level2' => esc_html__( 'The background color of the sidebar.', 'minimalistflex' ), + 'level3-dark' => esc_html__( 'The secondary text color. Should be lighter than the default color.', 'minimalistflex' ), + 'default' => esc_html__( 'The default text color.', 'minimalistflex' ), + 'link' => esc_html__( 'The link color.', 'minimalistflex' ), + 'link-hover' => esc_html__( 'The link color when hovered.', 'minimalistflex' ), + 'tint' => esc_html__( 'Tint color A. Should be a light color.', 'minimalistflex' ), + 'tint-dark' => esc_html__( 'A darker variant of the tint color A. Only used on the scroll bars.', 'minimalistflex' ), + 'tint-alt' => esc_html__( 'Tint color B. Should be a dark color.', 'minimalistflex' ), + 'tint-contrast' => esc_html__( 'Tint color C. Should be a *even darker* color.', 'minimalistflex' ), + 'contrast' => esc_html__( 'Text color on a light background. Better keep it as is.', 'minimalistflex' ), + 'contrast-dark' => esc_html__( 'Text color on a dark background. Better keep it as is.', 'minimalistflex' ), + 'footer-text' => esc_html__( 'The footer text color.', 'minimalistflex' ), + 'footer-bg' => esc_html__( 'The footer background color.', 'minimalistflex' ), + 'header-bg' => esc_html__( 'The background color of the header.', 'minimalistflex' ), + 'header-menu' => esc_html__( 'The background color of the navigation menu dropdown.', 'minimalistflex' ), + 'header-sidebar' => esc_html__( 'The background color of the submenus of the navigation menu dropdown.', 'minimalistflex' ), + 'header-text' => esc_html__( 'The text color of the navigation menu dropdown.', 'minimalistflex' ) ); \ No newline at end of file diff --git a/includes/colors.php b/includes/colors.php index 6e799b8..ee9e706 100644 --- a/includes/colors.php +++ b/includes/colors.php @@ -5,8 +5,7 @@ if ( !defined( 'WPINC' ) ) { ?>