16 $parent_file = 'options-general.php'; |
16 $parent_file = 'options-general.php'; |
17 |
17 |
18 /** |
18 /** |
19 * Display JavaScript on the page. |
19 * Display JavaScript on the page. |
20 * |
20 * |
21 * @package WordPress |
21 * @since 3.5.0 |
22 * @subpackage Reading_Settings_Screen |
|
23 */ |
22 */ |
24 function add_js() { |
23 function options_reading_add_js() { |
25 ?> |
24 ?> |
26 <script type="text/javascript"> |
25 <script type="text/javascript"> |
27 //<![CDATA[ |
26 //<![CDATA[ |
28 jQuery(document).ready(function($){ |
27 jQuery(document).ready(function($){ |
29 var section = $('#front-static-pages'), |
28 var section = $('#front-static-pages'), |
37 }); |
36 }); |
38 //]]> |
37 //]]> |
39 </script> |
38 </script> |
40 <?php |
39 <?php |
41 } |
40 } |
42 add_action('admin_head', 'add_js'); |
41 add_action('admin_head', 'options_reading_add_js'); |
|
42 |
|
43 /** |
|
44 * Render the blog charset setting. |
|
45 * |
|
46 * @since 3.5.0 |
|
47 */ |
|
48 function options_reading_blog_charset() { |
|
49 echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />'; |
|
50 echo '<p class="description">' . __( 'The <a href="http://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>'; |
|
51 } |
43 |
52 |
44 get_current_screen()->add_help_tab( array( |
53 get_current_screen()->add_help_tab( array( |
45 'id' => 'overview', |
54 'id' => 'overview', |
46 'title' => __('Overview'), |
55 'title' => __('Overview'), |
47 'content' => '<p>' . __('This screen contains the settings that affect the display of your content.') . '</p>' . |
56 'content' => '<p>' . __('This screen contains the settings that affect the display of your content.') . '</p>' . |
48 '<p>' . sprintf(__('You can choose what’s displayed on the front page of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static home page, you first need to create two <a href="%s">Pages</a>. One will become the front page, and the other will be where your posts are displayed.'), 'post-new.php?post_type=page') . '</p>' . |
57 '<p>' . sprintf(__('You can choose what’s displayed on the front page of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static home page, you first need to create two <a href="%s">Pages</a>. One will become the front page, and the other will be where your posts are displayed.'), 'post-new.php?post_type=page') . '</p>' . |
49 '<p>' . __('You can also control the display of your content in RSS feeds, including the maximum numbers of posts to display, whether to show full text or a summary, and the character set encoding.') . '</p>' . |
58 '<p>' . __('You can also control the display of your content in RSS feeds, including the maximum numbers of posts to display and whether to show full text or a summary.') . '</p>' . |
50 '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>', |
59 '<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>', |
|
60 ) ); |
|
61 |
|
62 get_current_screen()->add_help_tab( array( |
|
63 'id' => 'site-visibility', |
|
64 'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site Visibility' ) : __( 'Search Engine Visibility' ), |
|
65 '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>' . |
|
66 '<p>' . __( 'When this setting is in effect, a reminder is shown in the Right Now box of the Dashboard that says, “Search Engines Discouraged,” to remind you that your site is not being crawled.' ) . '</p>', |
51 ) ); |
67 ) ); |
52 |
68 |
53 get_current_screen()->set_help_sidebar( |
69 get_current_screen()->set_help_sidebar( |
54 '<p><strong>' . __('For more information:') . '</strong></p>' . |
70 '<p><strong>' . __('For more information:') . '</strong></p>' . |
55 '<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>') . '</p>' . |
71 '<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>') . '</p>' . |
61 |
77 |
62 <div class="wrap"> |
78 <div class="wrap"> |
63 <?php screen_icon(); ?> |
79 <?php screen_icon(); ?> |
64 <h2><?php echo esc_html( $title ); ?></h2> |
80 <h2><?php echo esc_html( $title ); ?></h2> |
65 |
81 |
66 <form name="form1" method="post" action="options.php"> |
82 <form method="post" action="options.php"> |
67 <?php settings_fields( 'reading' ); ?> |
83 <?php |
|
84 settings_fields( 'reading' ); |
|
85 |
|
86 if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) |
|
87 add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) ); |
|
88 ?> |
68 |
89 |
69 <?php if ( ! get_pages() ) : ?> |
90 <?php if ( ! get_pages() ) : ?> |
70 <input name="show_on_front" type="hidden" value="posts" /> |
91 <input name="show_on_front" type="hidden" value="posts" /> |
71 <table class="form-table"> |
92 <table class="form-table"> |
72 <?php |
93 <?php |
118 <p><label><input name="rss_use_excerpt" type="radio" value="0" <?php checked( 0, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Full text' ); ?></label><br /> |
139 <p><label><input name="rss_use_excerpt" type="radio" value="0" <?php checked( 0, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Full text' ); ?></label><br /> |
119 <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label></p> |
140 <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label></p> |
120 </fieldset></td> |
141 </fieldset></td> |
121 </tr> |
142 </tr> |
122 |
143 |
123 <tr valign="top"> |
144 <tr valign="top" class="option-site-visibility"> |
124 <th scope="row"><label for="blog_charset"><?php _e( 'Encoding for pages and feeds' ); ?></label></th> |
145 <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </th> |
125 <td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option( 'blog_charset' ); ?>" class="regular-text" /> |
146 <td><fieldset><legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend> |
126 <p class="description"><?php _e( 'The <a href="http://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended, if you are adventurous there are some <a href="http://en.wikipedia.org/wiki/Character_set">other encodings</a>)' ); ?></p></td> |
147 <?php if ( has_action( 'blog_privacy_selector' ) ) : ?> |
|
148 <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> /> |
|
149 <label for="blog-public"><?php _e( 'Allow search engines to index this site' );?></label><br/> |
|
150 <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> /> |
|
151 <label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label> |
|
152 <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> |
|
153 <?php do_action('blog_privacy_selector'); ?> |
|
154 <?php else : ?> |
|
155 <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> /> |
|
156 <?php _e( 'Discourage search engines from indexing this site' ); ?></label> |
|
157 <p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p> |
|
158 <?php endif; ?> |
|
159 </fieldset></td> |
127 </tr> |
160 </tr> |
|
161 |
128 <?php do_settings_fields( 'reading', 'default' ); ?> |
162 <?php do_settings_fields( 'reading', 'default' ); ?> |
129 </table> |
163 </table> |
130 |
164 |
131 <?php do_settings_sections( 'reading' ); ?> |
165 <?php do_settings_sections( 'reading' ); ?> |
132 |
166 |