Changeset 42343 for trunk/src/wp-admin/options-reading.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/options-reading.php
r42201 r42343 10 10 require_once( dirname( __FILE__ ) . '/admin.php' ); 11 11 12 if ( ! current_user_can( 'manage_options' ) ) 12 if ( ! current_user_can( 'manage_options' ) ) { 13 13 wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) ); 14 } 14 15 15 $title = __( 'Reading Settings' );16 $title = __( 'Reading Settings' ); 16 17 $parent_file = 'options-general.php'; 17 18 18 add_action( 'admin_head', 'options_reading_add_js');19 add_action( 'admin_head', 'options_reading_add_js' ); 19 20 20 get_current_screen()->add_help_tab( array( 21 'id' => 'overview', 22 'title' => __('Overview'), 23 'content' => '<p>' . __('This screen contains the settings that affect the display of your content.') . '</p>' . 24 '<p>' . sprintf(__('You can choose what’s displayed on the homepage of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static homepage, you first need to create two <a href="%s">Pages</a>. One will become the homepage, and the other will be where your posts are displayed.'), 'post-new.php?post_type=page') . '</p>' . 25 '<p>' . __('You can also control the display of your content in RSS feeds, including the maximum number of posts to display and whether to show full text or a summary.') . '</p>' . 26 '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>', 27 ) ); 21 get_current_screen()->add_help_tab( 22 array( 23 'id' => 'overview', 24 'title' => __( 'Overview' ), 25 'content' => '<p>' . __( 'This screen contains the settings that affect the display of your content.' ) . '</p>' . 26 '<p>' . sprintf( __( 'You can choose what’s displayed on the homepage of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static homepage, you first need to create two <a href="%s">Pages</a>. One will become the homepage, and the other will be where your posts are displayed.' ), 'post-new.php?post_type=page' ) . '</p>' . 27 '<p>' . __( 'You can also control the display of your content in RSS feeds, including the maximum number of posts to display and whether to show full text or a summary.' ) . '</p>' . 28 '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>', 29 ) 30 ); 28 31 29 get_current_screen()->add_help_tab( array( 30 'id' => 'site-visibility', 31 'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site Visibility' ) : __( 'Search Engine Visibility' ), 32 'content' => '<p>' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to “Discourage search engines from indexing this site” and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.' ) . '</p>' . 33 '<p>' . __( 'When this setting is in effect, a reminder is shown in the At a Glance box of the Dashboard that says, “Search Engines Discouraged,” to remind you that your site is not being crawled.' ) . '</p>', 34 ) ); 32 get_current_screen()->add_help_tab( 33 array( 34 'id' => 'site-visibility', 35 'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site Visibility' ) : __( 'Search Engine Visibility' ), 36 'content' => '<p>' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the checkbox next to “Discourage search engines from indexing this site” and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.' ) . '</p>' . 37 '<p>' . __( 'When this setting is in effect, a reminder is shown in the At a Glance box of the Dashboard that says, “Search Engines Discouraged,” to remind you that your site is not being crawled.' ) . '</p>', 38 ) 39 ); 35 40 36 41 get_current_screen()->set_help_sidebar( 37 '<p><strong>' . __( 'For more information:') . '</strong></p>' .38 '<p>' . __( '<a href="https://codex.wordpress.org/Settings_Reading_Screen">Documentation on Reading Settings</a>') . '</p>' .39 '<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'42 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 43 '<p>' . __( '<a href="https://codex.wordpress.org/Settings_Reading_Screen">Documentation on Reading Settings</a>' ) . '</p>' . 44 '<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>' 40 45 ); 41 46 … … 50 55 settings_fields( 'reading' ); 51 56 52 if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) 57 if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) { 53 58 add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) ); 59 } 54 60 ?> 55 61 … … 58 64 <table class="form-table"> 59 65 <?php 60 61 66 if ( 'posts' != get_option( 'show_on_front' ) ) : 67 update_option( 'show_on_front', 'posts' ); 62 68 endif; 63 69 64 70 else : 65 if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) 71 if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) { 66 72 update_option( 'show_on_front', 'posts' ); 73 } 67 74 ?> 68 75 <table class="form-table"> … … 81 88 </p> 82 89 <ul> 83 <li><label for="page_on_front"><?php printf( __( 'Homepage: %s' ), wp_dropdown_pages( array( 'name' => 'page_on_front', 'echo' => 0, 'show_option_none' => __( '— Select —' ), 'option_none_value' => '0', 'selected' => get_option( 'page_on_front' ) ) ) ); ?></label></li> 84 <li><label for="page_for_posts"><?php printf( __( 'Posts page: %s' ), wp_dropdown_pages( array( 'name' => 'page_for_posts', 'echo' => 0, 'show_option_none' => __( '— Select —' ), 'option_none_value' => '0', 'selected' => get_option( 'page_for_posts' ) ) ) ); ?></label></li> 90 <li><label for="page_on_front"> 91 <?php 92 printf( 93 __( 'Homepage: %s' ), wp_dropdown_pages( 94 array( 95 'name' => 'page_on_front', 96 'echo' => 0, 97 'show_option_none' => __( '— Select —' ), 98 'option_none_value' => '0', 99 'selected' => get_option( 'page_on_front' ), 100 ) 101 ) 102 ); 103 ?> 104 </label></li> 105 <li><label for="page_for_posts"> 106 <?php 107 printf( 108 __( 'Posts page: %s' ), wp_dropdown_pages( 109 array( 110 'name' => 'page_for_posts', 111 'echo' => 0, 112 'show_option_none' => __( '— Select —' ), 113 'option_none_value' => '0', 114 'selected' => get_option( 'page_for_posts' ), 115 ) 116 ) 117 ); 118 ?> 119 </label></li> 85 120 </ul> 86 121 <?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?> … … 112 147 <td><fieldset><legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend> 113 148 <?php if ( has_action( 'blog_privacy_selector' ) ) : ?> 114 <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( '1', get_option('blog_public')); ?> />115 <label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br/>116 <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( '0', get_option('blog_public')); ?> />149 <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( '1', get_option( 'blog_public' ) ); ?> /> 150 <label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br/> 151 <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> /> 117 152 <label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label> 118 153 <p class="description"><?php _e( 'Note: Neither of these options blocks access to your site — it is up to search engines to honor your request.' ); ?></p>
Note: See TracChangeset
for help on using the changeset viewer.