Make WordPress Core


Ignore:
Timestamp:
12/14/2021 04:12:57 PM (4 years ago)
Author:
hellofromTonya
Message:

Themes: Rename public static functions in WP_Theme_JSON_Resolver to remove custom_post_type references.

WordPress Core is not really custom and does not reference "custom post type" in its function naming. This commit renames 2 public static methods:

  • WP_Theme_JSON_Resolver::get_user_custom_post_type_id() renamed to WP_Theme_JSON_Resolver::get_user_global_styles_post_id().
  • WP_Theme_JSON_Resolver::get_user_data_from_custom_post_type() renamed to WP_Theme_JSON_Resolver:: get_user_data_from_wp_global_styles().

Follow-up to [52049], [52051], [52069], [52232], [52275], [52364].

Props antonvlasenko, bernhard-reiter, costdev, desrosj, hellofromTonya, noisysocks, oandregal, SergeyBiryukov.
Fixes #54517.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php

    r52275 r52372  
    319319        if ( $theme->get_stylesheet() === wp_get_theme()->get_stylesheet() ) {
    320320            // This creates a record for the current theme if not existent.
    321             $id = WP_Theme_JSON_Resolver::get_user_custom_post_type_id();
     321            $id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id();
    322322        } else {
    323             $user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_custom_post_type( $theme );
     323            $user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme );
    324324            $id       = isset( $user_cpt['ID'] ) ? $user_cpt['ID'] : null;
    325325        }
Note: See TracChangeset for help on using the changeset viewer.