Changeset 54818 for branches/6.1
- Timestamp:
- 11/11/2022 04:29:27 PM (2 years ago)
- Location:
- branches/6.1
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.1
-
branches/6.1/src/wp-admin/site-editor.php
r54792 r54818 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' ), -
branches/6.1/src/wp-includes/block-template-utils.php
r54767 r54818 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(); … … 707 707 $theme = $terms[0]->name; 708 708 $template_file = _get_block_template_file( $post->post_type, $post->post_name ); 709 $has_theme_file = wp_get_theme()->get_stylesheet() === $theme && null !== $template_file;709 $has_theme_file = get_stylesheet() === $theme && null !== $template_file; 710 710 711 711 $origin = get_post_meta( $post->ID, 'origin', true ); … … 904 904 'taxonomy' => 'wp_theme', 905 905 'field' => 'name', 906 'terms' => wp_get_theme()->get_stylesheet(),906 'terms' => get_stylesheet(), 907 907 ), 908 908 ), … … 970 970 971 971 $is_not_custom = false === array_search( 972 wp_get_theme()->get_stylesheet() . '//' . $template_file['slug'],972 get_stylesheet() . '//' . $template_file['slug'], 973 973 wp_list_pluck( $query_result, 'id' ), 974 974 true … … 1111 1111 list( $theme, $slug ) = $parts; 1112 1112 1113 if ( wp_get_theme()->get_stylesheet() !== $theme ) {1113 if ( get_stylesheet() !== $theme ) { 1114 1114 /** This filter is documented in wp-includes/block-template-utils.php */ 1115 1115 return apply_filters( 'get_block_file_template', null, $id, $template_type ); -
branches/6.1/src/wp-includes/block-template.php
r54792 r54818 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 ); -
branches/6.1/src/wp-includes/blocks/template-part.php
r54812 r54818 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']; -
branches/6.1/src/wp-includes/class-wp-theme-json-resolver.php
r54800 r54818 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 -
branches/6.1/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
r53760 r54818 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( -
branches/6.1/src/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php
r54356 r54818 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 ) { -
branches/6.1/src/wp-includes/theme-templates.php
r53331 r54818 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.