From 6ed1a7b615581296e42383c5714813f6d801bd7f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 9 Nov 2019 13:43:01 +0000 Subject: [PATCH] Docs: Correct the documentation placement for `wp_print_styles` and `shortcode_atts_{$shortcode}` hooks. Props jrf. See #48255. Built from https://develop.svn.wordpress.org/trunk@46688 git-svn-id: http://core.svn.wordpress.org/trunk@46488 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.wp-styles.php | 11 ++++++----- wp-includes/shortcodes.php | 29 +++++++++++++++-------------- wp-includes/version.php | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/wp-includes/functions.wp-styles.php b/wp-includes/functions.wp-styles.php index a60a9d6224..49c947c420 100644 --- a/wp-includes/functions.wp-styles.php +++ b/wp-includes/functions.wp-styles.php @@ -43,12 +43,13 @@ function wp_print_styles( $handles = false ) { if ( '' === $handles ) { // for wp_head $handles = false; } - /** - * Fires before styles in the $handles queue are printed. - * - * @since 2.6.0 - */ + if ( ! $handles ) { + /** + * Fires before styles in the $handles queue are printed. + * + * @since 2.6.0 + */ do_action( 'wp_print_styles' ); } diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index 465293d9f9..a5e806b40d 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -558,21 +558,22 @@ function shortcode_atts( $pairs, $atts, $shortcode = '' ) { $out[ $name ] = $default; } } - /** - * Filters a shortcode's default attributes. - * - * If the third parameter of the shortcode_atts() function is present then this filter is available. - * The third parameter, $shortcode, is the name of the shortcode. - * - * @since 3.6.0 - * @since 4.4.0 Added the `$shortcode` parameter. - * - * @param array $out The output array of shortcode attributes. - * @param array $pairs The supported attributes and their defaults. - * @param array $atts The user defined shortcode attributes. - * @param string $shortcode The shortcode name. - */ + if ( $shortcode ) { + /** + * Filters a shortcode's default attributes. + * + * If the third parameter of the shortcode_atts() function is present then this filter is available. + * The third parameter, $shortcode, is the name of the shortcode. + * + * @since 3.6.0 + * @since 4.4.0 Added the `$shortcode` parameter. + * + * @param array $out The output array of shortcode attributes. + * @param array $pairs The supported attributes and their defaults. + * @param array $atts The user defined shortcode attributes. + * @param string $shortcode The shortcode name. + */ $out = apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts, $shortcode ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 9a7ebecc24..5f089e7ee7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46687'; +$wp_version = '5.4-alpha-46688'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.