Make WordPress Core

Changeset 34605


Ignore:
Timestamp:
09/26/2015 08:53:32 PM (9 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template-functions.php

    r34566 r34605  
    16321632    }
    16331633
    1634     if ( get_option( 'page_on_front' ) == $post->ID ) {
    1635         $post_states['page_on_front'] = __( 'Front Page' );
    1636     }
    1637 
    1638     if ( get_option( 'page_for_posts' ) == $post->ID ) {
    1639         $post_states['page_for_posts'] = __( 'Posts Page' );
     1634    if ( 'page' === get_option( 'show_on_front' ) ) {
     1635        if ( intval( get_option( 'page_on_front' ) ) === $post->ID ) {
     1636            $post_states['page_on_front'] = __( 'Front Page' );
     1637        }
     1638
     1639        if ( intval( get_option( 'page_for_posts' ) ) === $post->ID ) {
     1640            $post_states['page_for_posts'] = __( 'Posts Page' );
     1641        }
    16401642    }
    16411643
Note: See TracChangeset for help on using the changeset viewer.