- Timestamp:
- 11/11/2022 04:24:47 PM (2 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/site-editor.php
r54786 r54817 102 102 103 103 $active_global_styles_id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id(); 104 $active_theme = wp_get_theme()->get_stylesheet();104 $active_theme = get_stylesheet(); 105 105 $preload_paths = array( 106 106 array( '/wp/v2/media', 'OPTIONS' ), -
trunk/src/wp-includes/block-template-utils.php
r54761 r54817 438 438 ! isset( $block['attrs']['theme'] ) 439 439 ) { 440 $block['attrs']['theme'] = wp_get_theme()->get_stylesheet();440 $block['attrs']['theme'] = get_stylesheet(); 441 441 $has_updated_content = true; 442 442 } … … 500 500 $default_template_types = get_default_block_template_types(); 501 501 $template_content = file_get_contents( $template_file['path'] ); 502 $theme = wp_get_theme()->get_stylesheet();502 $theme = get_stylesheet(); 503 503 504 504 $template = new WP_Block_Template(); … … 711 711 $theme = $terms[0]->name; 712 712 $template_file = _get_block_template_file( $post->post_type, $post->post_name ); 713 $has_theme_file = wp_get_theme()->get_stylesheet() === $theme && null !== $template_file;713 $has_theme_file = get_stylesheet() === $theme && null !== $template_file; 714 714 715 715 $origin = get_post_meta( $post->ID, 'origin', true ); … … 908 908 'taxonomy' => 'wp_theme', 909 909 'field' => 'name', 910 'terms' => wp_get_theme()->get_stylesheet(),910 'terms' => get_stylesheet(), 911 911 ), 912 912 ), … … 974 974 975 975 $is_not_custom = false === array_search( 976 wp_get_theme()->get_stylesheet() . '//' . $template_file['slug'],976 get_stylesheet() . '//' . $template_file['slug'], 977 977 wp_list_pluck( $query_result, 'id' ), 978 978 true … … 1115 1115 list( $theme, $slug ) = $parts; 1116 1116 1117 if ( wp_get_theme()->get_stylesheet() !== $theme ) {1117 if ( get_stylesheet() !== $theme ) { 1118 1118 /** This filter is documented in wp-includes/block-template-utils.php */ 1119 1119 return apply_filters( 'get_block_file_template', null, $id, $template_type ); -
trunk/src/wp-includes/block-template.php
r54786 r54817 146 146 // Find all potential templates 'wp_template' post matching the hierarchy. 147 147 $query = array( 148 'theme' => wp_get_theme()->get_stylesheet(),148 'theme' => get_stylesheet(), 149 149 'slug__in' => $slugs, 150 150 ); -
trunk/src/wp-includes/blocks/template-part.php
r54811 r54817 23 23 isset( $attributes['slug'] ) && 24 24 isset( $attributes['theme'] ) && 25 wp_get_theme()->get_stylesheet() === $attributes['theme']25 get_stylesheet() === $attributes['theme'] 26 26 ) { 27 27 $template_part_id = $attributes['theme'] . '//' . $attributes['slug']; -
trunk/src/wp-includes/class-wp-theme-json-resolver.php
r54799 r54817 244 244 } 245 245 246 $options = wp_parse_args( $options, array( 'with_supports' => true ) );246 $options = wp_parse_args( $options, array( 'with_supports' => true ) ); 247 247 248 248 if ( null === static::$theme || ! static::has_same_registered_blocks( 'theme' ) ) { 249 249 $theme_json_file = static::get_file_path_from_theme( 'theme.json' ); 250 $wp_theme = wp_get_theme(); 250 251 if ( '' !== $theme_json_file ) { 251 252 $theme_json_data = static::read_json_file( $theme_json_file ); 252 $theme_json_data = static::translate( $theme_json_data, wp_get_theme()->get( 'TextDomain' ) );253 $theme_json_data = static::translate( $theme_json_data, $wp_theme->get( 'TextDomain' ) ); 253 254 } else { 254 255 $theme_json_data = array(); … … 266 267 static::$theme = new WP_Theme_JSON( $theme_json_data ); 267 268 268 if ( wp_get_theme()->parent() ) {269 if ( $wp_theme->parent() ) { 269 270 // Get parent theme.json. 270 271 $parent_theme_json_file = static::get_file_path_from_theme( 'theme.json', true ); 271 272 if ( '' !== $parent_theme_json_file ) { 272 273 $parent_theme_json_data = static::read_json_file( $parent_theme_json_file ); 273 $parent_theme_json_data = static::translate( $parent_theme_json_data, wp_get_theme()->parent()->get( 'TextDomain' ) );274 $parent_theme_json_data = static::translate( $parent_theme_json_data, $wp_theme->parent()->get( 'TextDomain' ) ); 274 275 $parent_theme = new WP_Theme_JSON( $parent_theme_json_data ); 275 276 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
r53760 r54817 565 565 */ 566 566 public function get_theme_item( $request ) { 567 if ( wp_get_theme()->get_stylesheet() !== $request['stylesheet'] ) {567 if ( get_stylesheet() !== $request['stylesheet'] ) { 568 568 // This endpoint only supports the active theme for now. 569 569 return new WP_Error( … … 639 639 */ 640 640 public function get_theme_items( $request ) { 641 if ( wp_get_theme()->get_stylesheet() !== $request['stylesheet'] ) {641 if ( get_stylesheet() !== $request['stylesheet'] ) { 642 642 // This endpoint only supports the active theme for now. 643 643 return new WP_Error( -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php
r54356 r54817 529 529 $changes->post_status = 'publish'; 530 530 $changes->tax_input = array( 531 'wp_theme' => isset( $request['theme'] ) ? $request['theme'] : wp_get_theme()->get_stylesheet(),531 'wp_theme' => isset( $request['theme'] ) ? $request['theme'] : get_stylesheet(), 532 532 ); 533 533 } elseif ( 'custom' !== $template->source ) { -
trunk/src/wp-includes/theme-templates.php
r53331 r54817 28 28 $terms = get_the_terms( $post_id, 'wp_theme' ); 29 29 if ( ! is_array( $terms ) || ! count( $terms ) ) { 30 wp_set_post_terms( $post_id, wp_get_theme()->get_stylesheet(), 'wp_theme' );30 wp_set_post_terms( $post_id, get_stylesheet(), 'wp_theme' ); 31 31 } 32 32 } … … 61 61 * to the entity. So for now we use the currently activated theme for creation. 62 62 */ 63 $theme = wp_get_theme()->get_stylesheet();63 $theme = get_stylesheet(); 64 64 $terms = get_the_terms( $post_ID, 'wp_theme' ); 65 65 if ( $terms && ! is_wp_error( $terms ) ) {
Note: See TracChangeset
for help on using the changeset viewer.