Changeset 54048
- Timestamp:
- 09/01/2022 03:43:25 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-loader.php
r53956 r54048 2896 2896 2897 2897 /** 2898 * This function takes care of adding inline styles 2899 * in the proper place, depending on the theme in use. 2898 * Hooks inline styles in the proper place, depending on the active theme. 2900 2899 * 2901 2900 * @since 5.9.1 2902 * 2903 * For block themes, it's loaded in the head. 2904 * For classic ones, it's loaded in the body 2905 * because the wp_head action happens before 2906 * the render_block. 2901 * @since 6.1.0 Added the `$priority` parameter. 2902 * 2903 * For block themes, styles are loaded in the head. 2904 * For classic ones, styles are loaded in the body because the wp_head action happens before render_block. 2907 2905 * 2908 2906 * @link https://core.trac.wordpress.org/ticket/53494. 2909 2907 * 2910 * @param string $style String containing the CSS styles to be added. 2911 */ 2912 function wp_enqueue_block_support_styles( $style ) { 2908 * @param string $style String containing the CSS styles to be added. 2909 * @param int $priority To set the priority for the add_action. 2910 */ 2911 function wp_enqueue_block_support_styles( $style, $priority = 10 ) { 2913 2912 $action_hook_name = 'wp_footer'; 2914 2913 if ( wp_is_block_theme() ) { … … 2919 2918 static function () use ( $style ) { 2920 2919 echo "<style>$style</style>\n"; 2921 } 2920 }, 2921 $priority 2922 2922 ); 2923 2923 }
Note: See TracChangeset
for help on using the changeset viewer.