Skip to content

Commit

Permalink
Use theme textdomain
Browse files Browse the repository at this point in the history
this gives a well-known string and avoids the need
to parse the theme name for spaces, etc.
  • Loading branch information
oandregal committed Feb 11, 2020
1 parent 798a0d3 commit d950b5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/global-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function gutenberg_experimental_global_styles_get_from_file( $global_styles_path
function gutenberg_experimental_global_styles_get_user() {
$global_styles = array();
$user_cpt = gutenberg_experimental_global_styles_get_user_cpt( array( 'publish' ) );
if ( in_array( 'post_content', $user_cpt, true ) ) {
if ( array_key_exists( 'post_content', $user_cpt ) ) {
$decoded_data = json_decode( $user_cpt['post_content'], true );
if ( is_array( $decoded_data ) ) {
$global_styles = $decoded_data;
Expand All @@ -97,7 +97,7 @@ function gutenberg_experimental_global_styles_get_user() {
function gutenberg_experimental_global_styles_get_user_cpt( $post_status_filter = array( 'publish' ), $should_create_draft = false ) {
$user_cpt = array();
$post_type_filter = 'wp_global_styles';
$post_name_filter = 'wp-global-styles-' . strtolower( wp_get_theme()->get( 'Name' ) );
$post_name_filter = 'wp-global-styles-' . strtolower( wp_get_theme()->get( 'TextDomain' ) );
$recent_posts = wp_get_recent_posts(
array(
'numberposts' => 1,
Expand Down

0 comments on commit d950b5f

Please sign in to comment.