21 * @since 3.5.0 |
21 * @since 3.5.0 |
22 */ |
22 */ |
23 function options_reading_add_js() { |
23 function options_reading_add_js() { |
24 ?> |
24 ?> |
25 <script type="text/javascript"> |
25 <script type="text/javascript"> |
26 //<![CDATA[ |
|
27 jQuery(document).ready(function($){ |
26 jQuery(document).ready(function($){ |
28 var section = $('#front-static-pages'), |
27 var section = $('#front-static-pages'), |
29 staticPage = section.find('input:radio[value="page"]'), |
28 staticPage = section.find('input:radio[value="page"]'), |
30 selects = section.find('select'), |
29 selects = section.find('select'), |
31 check_disabled = function(){ |
30 check_disabled = function(){ |
32 selects.prop( 'disabled', ! staticPage.prop('checked') ); |
31 selects.prop( 'disabled', ! staticPage.prop('checked') ); |
33 }; |
32 }; |
34 check_disabled(); |
33 check_disabled(); |
35 section.find('input:radio').change(check_disabled); |
34 section.find('input:radio').change(check_disabled); |
36 }); |
35 }); |
37 //]]> |
|
38 </script> |
36 </script> |
39 <?php |
37 <?php |
40 } |
38 } |
41 add_action('admin_head', 'options_reading_add_js'); |
39 add_action('admin_head', 'options_reading_add_js'); |
42 |
40 |
45 * |
43 * |
46 * @since 3.5.0 |
44 * @since 3.5.0 |
47 */ |
45 */ |
48 function options_reading_blog_charset() { |
46 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" />'; |
47 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>'; |
48 echo '<p class="description">' . __( 'The <a href="https://codex.wordpress.org/Glossary#Character_set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>'; |
51 } |
49 } |
52 |
50 |
53 get_current_screen()->add_help_tab( array( |
51 get_current_screen()->add_help_tab( array( |
54 'id' => 'overview', |
52 'id' => 'overview', |
55 'title' => __('Overview'), |
53 'title' => __('Overview'), |
61 |
59 |
62 get_current_screen()->add_help_tab( array( |
60 get_current_screen()->add_help_tab( array( |
63 'id' => 'site-visibility', |
61 'id' => 'site-visibility', |
64 'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site Visibility' ) : __( 'Search Engine Visibility' ), |
62 '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>' . |
63 '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>', |
64 '<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>', |
67 ) ); |
65 ) ); |
68 |
66 |
69 get_current_screen()->set_help_sidebar( |
67 get_current_screen()->set_help_sidebar( |
70 '<p><strong>' . __('For more information:') . '</strong></p>' . |
68 '<p><strong>' . __('For more information:') . '</strong></p>' . |
71 '<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>') . '</p>' . |
69 '<p>' . __('<a href="https://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>') . '</p>' . |
72 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
70 '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
73 ); |
71 ); |
74 |
72 |
75 include( ABSPATH . 'wp-admin/admin-header.php' ); |
73 include( ABSPATH . 'wp-admin/admin-header.php' ); |
76 ?> |
74 ?> |
77 |
75 |
78 <div class="wrap"> |
76 <div class="wrap"> |
79 <?php screen_icon(); ?> |
|
80 <h2><?php echo esc_html( $title ); ?></h2> |
77 <h2><?php echo esc_html( $title ); ?></h2> |
81 |
78 |
82 <form method="post" action="options.php"> |
79 <form method="post" action="options.php"> |
83 <?php |
80 <?php |
84 settings_fields( 'reading' ); |
81 settings_fields( 'reading' ); |
98 else : |
95 else : |
99 if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) |
96 if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) |
100 update_option( 'show_on_front', 'posts' ); |
97 update_option( 'show_on_front', 'posts' ); |
101 ?> |
98 ?> |
102 <table class="form-table"> |
99 <table class="form-table"> |
103 <tr valign="top"> |
100 <tr> |
104 <th scope="row"><?php _e( 'Front page displays' ); ?></th> |
101 <th scope="row"><?php _e( 'Front page displays' ); ?></th> |
105 <td id="front-static-pages"><fieldset><legend class="screen-reader-text"><span><?php _e( 'Front page displays' ); ?></span></legend> |
102 <td id="front-static-pages"><fieldset><legend class="screen-reader-text"><span><?php _e( 'Front page displays' ); ?></span></legend> |
106 <p><label> |
103 <p><label> |
107 <input name="show_on_front" type="radio" value="posts" class="tog" <?php checked( 'posts', get_option( 'show_on_front' ) ); ?> /> |
104 <input name="show_on_front" type="radio" value="posts" class="tog" <?php checked( 'posts', get_option( 'show_on_front' ) ); ?> /> |
108 <?php _e( 'Your latest posts' ); ?> |
105 <?php _e( 'Your latest posts' ); ?> |
121 <div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div> |
118 <div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div> |
122 <?php endif; ?> |
119 <?php endif; ?> |
123 </fieldset></td> |
120 </fieldset></td> |
124 </tr> |
121 </tr> |
125 <?php endif; ?> |
122 <?php endif; ?> |
126 <tr valign="top"> |
123 <tr> |
127 <th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th> |
124 <th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th> |
128 <td> |
125 <td> |
129 <input name="posts_per_page" type="number" step="1" min="1" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?> |
126 <input name="posts_per_page" type="number" step="1" min="1" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?> |
130 </td> |
127 </td> |
131 </tr> |
128 </tr> |
132 <tr valign="top"> |
129 <tr> |
133 <th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th> |
130 <th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th> |
134 <td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td> |
131 <td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td> |
135 </tr> |
132 </tr> |
136 <tr valign="top"> |
133 <tr> |
137 <th scope="row"><?php _e( 'For each article in a feed, show' ); ?> </th> |
134 <th scope="row"><?php _e( 'For each article in a feed, show' ); ?> </th> |
138 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'For each article in a feed, show' ); ?> </span></legend> |
135 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'For each article in a feed, show' ); ?> </span></legend> |
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 /> |
136 <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 /> |
140 <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label></p> |
137 <label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label></p> |
141 </fieldset></td> |
138 </fieldset></td> |
142 </tr> |
139 </tr> |
143 |
140 |
144 <tr valign="top" class="option-site-visibility"> |
141 <tr class="option-site-visibility"> |
145 <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </th> |
142 <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </th> |
146 <td><fieldset><legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend> |
143 <td><fieldset><legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend> |
147 <?php if ( has_action( 'blog_privacy_selector' ) ) : ?> |
144 <?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')); ?> /> |
145 <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/> |
146 <label for="blog-public"><?php _e( 'Allow search engines to index this site' );?></label><br/> |