PluginProbe
Gutenberg / 14.7.0
Gutenberg v14.7.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
gutenberg / lib / compat / wordpress-6.1 / theme.php

theme.php in Gutenberg 14.7.0, at lib/compat/wordpress-6.1/theme.php

48 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Temporary compatibility shims for features present in Gutenberg.
4 * This file should be removed when WordPress 6.1.0 becomes the lowest
5 * supported version by this plugin.
6 *
7 * @package gutenberg
8 */
9
10 /**
11 * This function runs in addition to the core `create_initial_theme_features`.
12 * The 6.1 release needs to update the core function to include the body of this function.
13 *
14 * Creates the initial theme features when the 'setup_theme' action is fired.
15 *
16 * See {@see 'setup_theme'}.
17 *
18 * @since 5.5.0
19 * @since 6.0.1 The `block-templates` feature was added.
20 * @since 6.1.0 The `disable-layout-styles` feature was added.
21 */
22 function gutenberg_create_initial_theme_features() {
23 register_theme_feature(
24 'disable-layout-styles',
25 array(
26 'description' => __( 'Whether the theme disables generated layout styles.', 'gutenberg' ),
27 'show_in_rest' => true,
28 )
29 );
30 }
31 add_action( 'setup_theme', 'gutenberg_create_initial_theme_features', 0 );
32
33 if ( ! function_exists( 'wp_theme_get_element_class_name' ) ) {
34 /**
35 * Given an element name, returns a class name.
36 * Alias from WP_Theme_JSON_Gutenberg::get_element_class_name.
37 *
38 * @param string $element The name of the element.
39 *
40 * @return string The name of the class.
41 *
42 * @since 6.1.0
43 */
44 function wp_theme_get_element_class_name( $element ) {
45 return WP_Theme_JSON_Gutenberg::get_element_class_name( $element );
46 }
47 }
48