Make WordPress Core


Ignore:
Timestamp:
10/08/2012 09:25:13 PM (14 years ago)
Author:
nacin
Message:

Move the static front page saving routine to a single sanitize_option() callback for show_on_front. page_on_front and page_for_posts are now manually set by this callback, and not separately by options.php. see #16379.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-reading.php

    r22127 r22136  
    3333                if ( checked )
    3434                        $('#page_for_posts').prop('checked', true).change();
     35                else
     36                        section.removeClass('page-for-posts');
    3537        });
    3638        $('#page_for_posts').change( function() {
    … …  
    117119        //       Otherwise, we must assume they cannot create pages (throughout), and thus
    118120        //       should fall back to the dropdown.
    119         if ( ! $page_for_posts = get_page_by_path( sanitize_title( $title ) ) ) {
     121        $page_for_posts = get_page_by_path( sanitize_title( $title ) );
     122        if ( ! $page_for_posts || $page_for_posts->ID == get_option( 'page_on_front' ) ) {
    120123                $page_for_posts = get_default_post_to_edit( 'page', true );
    121124                $page_for_posts->post_title = $title;
Note: See TracChangeset for help on using the changeset viewer.