mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-14 01:24:27 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@34605 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user