Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
$10
remove reading static page setting
Thanks
Hi guys thanks for the try but none of these answers work.. I will try a different way to complete this task.
LOL when you increase your prize money the site charges you a second 90 cents..o well
Thanks and have a great day
RNWest | 11/18/11 at 8:02pm
Edit
Tutorial: How to assign prize money
Previous versions of this question:
11/19/11 at 6:32pm
| 11/19/11 at 6:37pm
| 11/19/11 at 6:42pm
The experts have suggested, on average, a prize of $11 for this question.
(3) Possible Answers Submitted...
See a chronological view of answers?
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
-

Last edited:
11/18/11
8:28pmGabriel Reguly says:Hi RNWest,
--Edit: Sorry, remove_option_whitelist( 'reading' ) seems to be the correct code.
remove_option_whitelist( 'reading' )
--
Try with unregister_setting( $option_group, $option_name, $sanitize_callback );
<?php unregister_setting( 'reading', $option_name, $sanitize_callback ); ?>
Regards,
GabrielPrevious versions of this answer: 11/18/11 at 8:28pm
- 11/18/11 8:36pm
RNWest says:Hi
Sorry this did not work..
The wordpress feature I am trying to remove is in wp-admin/options-reading.php
If this helps - 11/18/11 9:38pm
Gabriel Reguly says:Hi RNWest,
That file is hard-coded and you will need to edit it to remove the code, but when updating WordPress your changes will be lost.
However, with the following code in your functions.php you can prevent those fields from being changed:
if ( is_admin() ) {
function gr_filter_options( $whitelist_options ) {
$remove = array( 'reading' => array( 'show_on_front', 'page_on_front', 'page_for_posts' ) );
foreach( $remove as $page => $keys ) {
foreach ( $keys as $key ) {
if ( isset($whitelist_options[ $page ]) && is_array($whitelist_options[ $page ]) ) {
$pos = array_search( $key, $whitelist_options[ $page ] );
if ( $pos !== false )
unset( $whitelist_options[ $page ][ $pos ] );
}
}
}
return $whitelist_options;
}
add_filter( 'whitelist_options', 'gr_filter_options', 10, 1 );
}
Luis solution removes the link from the menu, but an user can still access the page wp-admin/options-reading.php.
Hope this helps you.
And I won't mind if you could afford adding more money to the prize ;-)
Regards,
Gabriel - 11/18/11 9:43pm
Gabriel Reguly says:BTW, options-reading.php should be like this: (based on WordPress 3.3)
<?php
/**
* Reading settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
$title = __( 'Reading Settings' );
$parent_file = 'options-general.php';
/**
* Display JavaScript on the page.
*
* @package WordPress
* @subpackage Reading_Settings_Screen
*/
function add_js() {
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($){
var section = $('#front-static-pages'),
staticPage = section.find('input:radio[value="page"]'),
selects = section.find('select'),
check_disabled = function(){
selects.prop( 'disabled', ! staticPage.prop('checked') );
};
check_disabled();
section.find('input:radio').change(check_disabled);
});
//]]>
</script>
<?php
}
add_action('admin_head', 'add_js');
add_contextual_help($current_screen,
'<p>' . __('This screen contains the settings that affect the display of your content.') . '</p>' .
'<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>' .
'<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>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>' .
'<p>' . __('For more information:') . '</p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include( './admin-header.php' );
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form name="form1" method="post" action="options.php">
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th>
<td>
<input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th>
<td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e( 'For each article in a feed, show' ); ?> </th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'For each article in a feed, show' ); ?> </span></legend>
<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 />
<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label></p>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><label for="blog_charset"><?php _e( 'Encoding for pages and feeds' ); ?></label></th>
<td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option( 'blog_charset' ); ?>" class="regular-text" />
<span 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>)' ); ?></span></td>
</tr>
<?php do_settings_fields( 'reading', 'default' ); ?>
</table>
<?php do_settings_sections( 'reading' ); ?>
<?php submit_button(); ?>
</form>
</div>
<?php include( './admin-footer.php' ); ?>
- 11/18/11 10:02pm
Gabriel Reguly says:Err, sorry.
Actually there is something missing.
Correct options-reading.php follows:
<?php
/**
* Reading settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
$title = __( 'Reading Settings' );
$parent_file = 'options-general.php';
/**
* Display JavaScript on the page.
*
* @package WordPress
* @subpackage Reading_Settings_Screen
*/
function add_js() {
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($){
var section = $('#front-static-pages'),
staticPage = section.find('input:radio[value="page"]'),
selects = section.find('select'),
check_disabled = function(){
selects.prop( 'disabled', ! staticPage.prop('checked') );
};
check_disabled();
section.find('input:radio').change(check_disabled);
});
//]]>
</script>
<?php
}
add_action('admin_head', 'add_js');
add_contextual_help($current_screen,
'<p>' . __('This screen contains the settings that affect the display of your content.') . '</p>' .
'<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>' .
'<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>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>' .
'<p>' . __('For more information:') . '</p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include( './admin-header.php' );
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form name="form1" method="post" action="options.php">
<?php settings_fields( 'reading' ); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th>
<td>
<input name="posts_per_page" type="text" id="posts_per_page" value="<?php form_option( 'posts_per_page' ); ?>" class="small-text" /> <?php _e( 'posts' ); ?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th>
<td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td>
</tr>
<tr valign="top">
<th scope="row"><?php _e( 'For each article in a feed, show' ); ?> </th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'For each article in a feed, show' ); ?> </span></legend>
<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 />
<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Summary' ); ?></label></p>
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><label for="blog_charset"><?php _e( 'Encoding for pages and feeds' ); ?></label></th>
<td><input name="blog_charset" type="text" id="blog_charset" value="<?php form_option( 'blog_charset' ); ?>" class="regular-text" />
<span 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>)' ); ?></span></td>
</tr>
<?php do_settings_fields( 'reading', 'default' ); ?>
</table>
<?php do_settings_sections( 'reading' ); ?>
<?php submit_button(); ?>
</form>
</div>
<?php include( './admin-footer.php' ); ?>
- 11/20/11 4:42am
Gabriel Reguly says:Hi RNWest,
Sorry, but how my answer does not work for you?
What is your WordPress version?
The functions.php code prevents the updating of the fields, so despite the fact that they are shown at options-reading.php, those fields are harmless now (in the lack of a better wording ;-)
And albeit editing core files is not the best approach, surely using my edited version those fields do not appear anymore. (Perhaps I could have only commented out the code, instead of removing the fields)
I have tested with WordPress 3.3 latest version, with multisite enabled.
Regards,
Gabriel
P.S. Thanks for increasing the prize.
Also thanks for sharing the fact that WP Questions charges a second 90 cents tax.
- 11/21/11 6:31am
Gabriel Reguly says:Hi RNWest,
Could you confirm that you abandoned the question?
Don't you want to try my solution?
Regards,
Gabriel - 11/21/11 7:12pm
RNWest says:Hi
Sorry got busy on other things,,
Yes, Gabriel your answers works but it was my fault for not being clear on my request.. I need to "Hide" this feature so the client will not see it..
Thanks - 11/21/11 7:26pm
Gabriel Reguly says:Hi RNWest,
Sorry, but does not my edited version of wp-admin/options-reading.php hides the Front page displays choice?
Please see attached image for clarification.
(And forgive me the Brazilian Portuguese :P )
Regards,
Gabriel
- 11/18/11 8:36pm
-

Last edited:
11/18/11
9:23pmLuis Abarca says:You can hide it from the menu
add_action('admin_menu', 'custom_admin_menu');
function custom_admin_menu()
{
global $menu;
global $submenu;
// Hide some submenus for no admins
if ( !current_user_can('manage_options') ) {
$submenu_urls = array(
'options-reading.php'
);
foreach ($submenu_urls as $submenu_url) {
foreach ($submenu[$submenu_url] as $key => $value) {
if ($value[0] == __('Reading')) {
unset($submenu[$submenu_url][$key]);
}
} // endforeach
} // endforeach
} // endif
}
Previous versions of this answer: 11/18/11 at 9:20pm | 11/18/11 at 9:23pm
-

Last edited:
11/18/11
11:39pm
This question has expired.
Current status of this question: Community pot
Please log in to add additional discourse to this page.
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
