updated theme Twenty Nineteen version 1.7

This commit is contained in:
2020-08-13 14:53:54 +00:00
committed by Gitium
parent d748d6088b
commit f1c4277fcd
17 changed files with 1970 additions and 1940 deletions

View File

@ -18,7 +18,7 @@ function twentynineteen_custom_colors_css() {
}
/**
* Filter Twenty Nineteen default saturation level.
* Filters Twenty Nineteen default saturation level.
*
* @since Twenty Nineteen 1.0
*
@ -28,7 +28,7 @@ function twentynineteen_custom_colors_css() {
$saturation = absint( $saturation ) . '%';
/**
* Filter Twenty Nineteen default selection saturation level.
* Filters Twenty Nineteen default selection saturation level.
*
* @since Twenty Nineteen 1.0
*
@ -38,7 +38,7 @@ function twentynineteen_custom_colors_css() {
$saturation_selection = $saturation_selection . '%';
/**
* Filter Twenty Nineteen default lightness level.
* Filters Twenty Nineteen default lightness level.
*
* @since Twenty Nineteen 1.0
*
@ -48,7 +48,7 @@ function twentynineteen_custom_colors_css() {
$lightness = absint( $lightness ) . '%';
/**
* Filter Twenty Nineteen default hover lightness level.
* Filters Twenty Nineteen default hover lightness level.
*
* @since Twenty Nineteen 1.0
*
@ -58,7 +58,7 @@ function twentynineteen_custom_colors_css() {
$lightness_hover = absint( $lightness_hover ) . '%';
/**
* Filter Twenty Nineteen default selection lightness level.
* Filters Twenty Nineteen default selection lightness level.
*
* @since Twenty Nineteen 1.0
*

View File

@ -141,7 +141,6 @@ add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' );
* Sanitize custom color choice.
*
* @param string $choice Whether image filter is active.
*
* @return string
*/
function twentynineteen_sanitize_color_option( $choice ) {

View File

@ -31,11 +31,11 @@ function twentynineteen_get_social_link_svg( $uri, $size = 24 ) {
/**
* Display SVG icons in social links menu.
*
* @param string $item_output The menu item output.
* @param WP_Post $item Menu item object.
* @param int $depth Depth of the menu.
* @param array $args wp_nav_menu() arguments.
* @return string $item_output The menu item output with social icon.
* @param string $item_output The menu item's starting HTML output.
* @param WP_Post $item Menu item data object.
* @param int $depth Depth of the menu. Used for padding.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @return string The menu item output with social icon.
*/
function twentynineteen_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
// Change SVG icon inside social links menu if there is supported URL.
@ -54,18 +54,17 @@ add_filter( 'walker_nav_menu_start_el', 'twentynineteen_nav_menu_social_icons',
/**
* Add a dropdown icon to top-level menu items.
*
* @param string $output Nav menu item start element.
* @param object $item Nav menu item.
* @param int $depth Depth.
* @param object $args Nav menu args.
* @param string $item_output The menu item's starting HTML output.
* @param WP_Post $item Menu item data object.
* @param int $depth Depth of the menu. Used for padding.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @return string Nav menu item start element.
* Add a dropdown icon to top-level menu items
*/
function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) {
function twentynineteen_add_dropdown_icons( $item_output, $item, $depth, $args ) {
// Only add class to 'top level' items on the 'primary' menu.
if ( ! isset( $args->theme_location ) || 'menu-1' !== $args->theme_location ) {
return $output;
return $item_output;
}
if ( in_array( 'mobile-parent-nav-menu-item', $item->classes, true ) && isset( $item->original_id ) ) {
@ -77,18 +76,18 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) {
);
// Replace opening <a> with <button>.
$output = preg_replace(
$item_output = preg_replace(
'/<a\s.*?>/',
$link,
$output,
$item_output,
1 // Limit.
);
// Replace closing </a> with </button>.
$output = preg_replace(
$item_output = preg_replace(
'#</a>#i',
'</button>',
$output,
$item_output,
1 // Limit.
);
@ -97,12 +96,12 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) {
// Add SVG icon to parent items.
$icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 );
$output .= sprintf(
$item_output .= sprintf(
'<button class="submenu-expand" tabindex="-1">%s</button>',
$icon
);
}
return $output;
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'twentynineteen_add_dropdown_icons', 10, 4 );

View File

@ -19,7 +19,7 @@ function twentynineteen_body_classes( $classes ) {
// Adds `singular` to singular pages.
$classes[] = 'singular';
} else {
// Adds `hfeed` to non singular pages.
// Adds `hfeed` to non-singular pages.
$classes[] = 'hfeed';
}