wp/wp-admin/options-reading.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    11 
    11 
    12 if ( ! current_user_can( 'manage_options' ) ) {
    12 if ( ! current_user_can( 'manage_options' ) ) {
    13 	wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
    13 	wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
    14 }
    14 }
    15 
    15 
       
    16 // Used in the HTML title tag.
    16 $title       = __( 'Reading Settings' );
    17 $title       = __( 'Reading Settings' );
    17 $parent_file = 'options-general.php';
    18 $parent_file = 'options-general.php';
    18 
    19 
    19 add_action( 'admin_head', 'options_reading_add_js' );
    20 add_action( 'admin_head', 'options_reading_add_js' );
    20 
    21 
    70 
    71 
    71 <?php if ( ! get_pages() ) : ?>
    72 <?php if ( ! get_pages() ) : ?>
    72 <input name="show_on_front" type="hidden" value="posts" />
    73 <input name="show_on_front" type="hidden" value="posts" />
    73 <table class="form-table" role="presentation">
    74 <table class="form-table" role="presentation">
    74 	<?php
    75 	<?php
    75 	if ( 'posts' != get_option( 'show_on_front' ) ) :
    76 	if ( 'posts' !== get_option( 'show_on_front' ) ) :
    76 		update_option( 'show_on_front', 'posts' );
    77 		update_option( 'show_on_front', 'posts' );
    77 	endif;
    78 	endif;
    78 
    79 
    79 else :
    80 else :
    80 	if ( 'page' === get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) {
    81 	if ( 'page' === get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) {
   188 	/**
   189 	/**
   189 	 * Enable the legacy 'Site visibility' privacy options.
   190 	 * Enable the legacy 'Site visibility' privacy options.
   190 	 *
   191 	 *
   191 	 * By default the privacy options form displays a single checkbox to 'discourage' search
   192 	 * By default the privacy options form displays a single checkbox to 'discourage' search
   192 	 * engines from indexing the site. Hooking to this action serves a dual purpose:
   193 	 * engines from indexing the site. Hooking to this action serves a dual purpose:
       
   194 	 *
   193 	 * 1. Disable the single checkbox in favor of a multiple-choice list of radio buttons.
   195 	 * 1. Disable the single checkbox in favor of a multiple-choice list of radio buttons.
   194 	 * 2. Open the door to adding additional radio button choices to the list.
   196 	 * 2. Open the door to adding additional radio button choices to the list.
   195 	 *
   197 	 *
   196 	 * Hooking to this action also converts the 'Search engine visibility' heading to the more
   198 	 * Hooking to this action also converts the 'Search engine visibility' heading to the more
   197 	 * open-ended 'Site visibility' heading.
   199 	 * open-ended 'Site visibility' heading.