Skip to content

Commit

Permalink
improved add_theme_support declaration to avoid warnings in theme_check
Browse files Browse the repository at this point in the history
  • Loading branch information
francgrasso committed Dec 20, 2021
1 parent 157ad96 commit d4bdc77
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 37 deletions.
50 changes: 24 additions & 26 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,48 +71,45 @@ function yith_proteo_setup() {
set_theme_mod( 'nav_menu_locations', $menu_locations );
}

$html5_args = array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
);

/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
add_theme_support( 'html5', $html5_args );

$custom_background_args = apply_filters(
'yith_proteo_custom_background_args',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'default-color' => 'ffffff',
'default-image' => '',
)
);

// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'yith_proteo_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
add_theme_support( 'custom-background', $custom_background_args );

// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );

$custom_logo_args = array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
);

/**
* Add support for core custom logo.
*/
add_theme_support(
'custom-logo',
array(
'height' => 250,
'width' => 250,
'flex-width' => true,
'flex-height' => true,
)
);
add_theme_support( 'custom-logo', $custom_logo_args );

/**
* Register additional image size
Expand Down Expand Up @@ -161,6 +158,7 @@ function yith_proteo_list_additional_image_sizes( $sizes ) {
add_theme_support( 'custom-units' );
add_theme_support( 'custom-line-height' );
add_theme_support( 'custom-spacing' );
add_theme_support( 'wp-block-styles' );

// Add support for experimental link color control.
add_theme_support( 'experimental-link-color' );
Expand Down
20 changes: 9 additions & 11 deletions inc/custom-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@
* @uses yith_proteo_header_style()
*/
function yith_proteo_custom_header_setup() {
add_theme_support(
'custom-header',
apply_filters(
'yith_proteo_custom_header_args',
array(
'default-image' => '',
'width' => 1920,
'flex-width' => true,
'height' => 250,
'flex-height' => true,
)
$custom_header_args = apply_filters(
'yith_proteo_custom_header_args',
array(
'default-image' => '',
'width' => 1920,
'flex-width' => true,
'height' => 250,
'flex-height' => true,
)
);
add_theme_support( 'custom-header', $custom_header_args );
}

add_action( 'after_setup_theme', 'yith_proteo_custom_header_setup' );

0 comments on commit d4bdc77

Please sign in to comment.