Fallback to the old function name in case users are still on the old version of Gutenberg (#5250)
This commit is contained in:
parent
47d758b63f
commit
18c6bcb1f8
2 changed files with 12 additions and 2 deletions
|
@ -162,7 +162,12 @@ class GlobalStylesColorCustomizer {
|
|||
$this->update_user_color_palette( $wp_customize );
|
||||
|
||||
// Get the user's theme.json from the CPT.
|
||||
$user_custom_post_type_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id();
|
||||
if ( method_exists( WP_Theme_JSON_Resolver_Gutenberg, 'get_user_global_styles_post_id' ) ) { // This is the new name.
|
||||
$user_custom_post_type_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id();
|
||||
} else if ( method_exists( WP_Theme_JSON_Resolver_Gutenberg, 'get_user_custom_post_type_id' ) ) { // This is the old name.
|
||||
$user_custom_post_type_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_custom_post_type_id();
|
||||
}
|
||||
|
||||
$user_theme_json_post = get_post( $user_custom_post_type_id );
|
||||
$user_theme_json_post_content = json_decode( $user_theme_json_post->post_content );
|
||||
|
||||
|
|
|
@ -505,7 +505,12 @@ class GlobalStylesFontsCustomizer {
|
|||
$heading_font_family_variable = 'var(--wp--preset--font-family--' . $heading_setting['slug'] . ')';
|
||||
|
||||
// Get the user's theme.json from the CPT.
|
||||
$user_custom_post_type_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id();
|
||||
if ( method_exists( WP_Theme_JSON_Resolver_Gutenberg, 'get_user_global_styles_post_id' ) ) { // This is the new name.
|
||||
$user_custom_post_type_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id();
|
||||
} else if ( method_exists( WP_Theme_JSON_Resolver_Gutenberg, 'get_user_custom_post_type_id' ) ) { // This is the old name.
|
||||
$user_custom_post_type_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_custom_post_type_id();
|
||||
}
|
||||
|
||||
$user_theme_json_post = get_post( $user_custom_post_type_id );
|
||||
$user_theme_json_post_content = json_decode( $user_theme_json_post->post_content );
|
||||
|
||||
|
|
Loading…
Reference in a new issue