From 7493641f861e388a5d1f219497f78de54bf87de7 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sat, 26 Sep 2015 20:54:25 +0000 Subject: [PATCH] Customize: Prevent showing "Front Page" and "Posts Page" states for pages in list table when `show_on_front` is not "page". Changing the `show_on_front` option back to "posts" also resets the `page_on_front` and `page_for_posts` options when updating via the Reading settings page. In the Customizer, however, this is not the case as these other options remain unchanged. This change accounts for this difference in behavior. Fixes #34004. Built from https://develop.svn.wordpress.org/trunk@34605 git-svn-id: http://core.svn.wordpress.org/trunk@34569 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template-functions.php | 12 +++++++----- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/template-functions.php b/wp-admin/includes/template-functions.php index 54d0a0a889..91a50fc5a7 100644 --- a/wp-admin/includes/template-functions.php +++ b/wp-admin/includes/template-functions.php @@ -1631,12 +1631,14 @@ function _post_states($post) { $post_states['scheduled'] = __( 'Scheduled' ); } - if ( get_option( 'page_on_front' ) == $post->ID ) { - $post_states['page_on_front'] = __( 'Front Page' ); - } + if ( 'page' === get_option( 'show_on_front' ) ) { + if ( intval( get_option( 'page_on_front' ) ) === $post->ID ) { + $post_states['page_on_front'] = __( 'Front Page' ); + } - if ( get_option( 'page_for_posts' ) == $post->ID ) { - $post_states['page_for_posts'] = __( 'Posts Page' ); + if ( intval( get_option( 'page_for_posts' ) ) === $post->ID ) { + $post_states['page_for_posts'] = __( 'Posts Page' ); + } } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index db917f4aaa..a5cb43d0a8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34604'; +$wp_version = '4.4-alpha-34605'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.