Community Forums › Forums › Archived Forums › Design Tips and Tricks › EDITOR can see APPEARANCE MENU in ADMIN
- This topic has 16 replies, 3 voices, and was last updated 10 years, 1 month ago by PhilMurray.
-
AuthorPosts
-
February 18, 2014 at 6:40 am #90937PhilMurrayParticipant
hi,
I added this code to me functions.php
/** ALLOW EDITOR TO MANAGE MENUS */
// get the the role object
$role_object = get_role( 'editor' );// add $cap capability to this role object
$role_object->add_cap( 'edit_theme_options' );this allowed an EDITOR to see the APPEARANCE menu in wordpress admin and manage menus etc.
however - the client decided they dod not require that functionality so i removed the code from functions.php and re-loaded it to the server. Yet if i log in as EDITOR the APPEARANCE menu is still visible in wordpress admin -- how can i fix this please?
i have some plugins like WORDPRESS ACCESS CONTROL, ERIDENT CUSTOM LOGIN running on the site but de-activating and re-activating them is making no difference
by default EDITORS should not see the APPEARANCE menu in wordpress - so how can i fix this please?
my theme is a customised genesis-sample theme and i am running the most recent version of wordpress and genesis
thanks
Phil
http://www.knockgolfclub.co.ukFebruary 18, 2014 at 6:57 am #90938Davinder Singh KainthMemberHave you tried code shared on this page - http://www.wpmayor.com/code/how-to-remove-menu-items-in-admin-depending-on-user-role/
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 18, 2014 at 7:04 am #90941PhilMurrayParticipantThanks Davinder - i will try this
I am just a bit confused how the EDITOR can see the APPEARANCE menu in the first place? especially since i removed the code below from my functions.php?
/** ALLOW EDITOR TO MANAGE MENUS */
// get the the role object
$role_object = get_role( ‘editor’ );// add $cap capability to this role object
$role_object->add_cap( ‘edit_theme_options’ );any idea why this would occur Davinder?
thanks
Phil
February 18, 2014 at 7:08 am #90942Davinder Singh KainthMemberCheck table on this page for clarity on user roles - http://codex.wordpress.org/Roles_and_Capabilities
I haven't used different user roles feature extensively. Could be some plugin or manual code you entered in functions.php file. Try to replicate this issue on local wordpress and check if that happens there. Also, try code shared in previous message.
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 18, 2014 at 7:12 am #90943Davinder Singh KainthMemberOk, I tried it on local WordPress. Created new user with 'editor' role and that user only saw following menu options (yup, appearance not visible!)
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 18, 2014 at 7:16 am #90945PhilMurrayParticipantGreat - thanks Davinder i will try that - this is my functions.php code below
<?php
// URL Re-direct
update_option('siteurl','http://www.knockgolfclub.co.uk');
update_option('home','http://www.knockgolfclub.co.uk');//* Start the engine
include_once( get_template_directory() . '/lib/init.php' );//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', 'FDM-Theme3.0' );
define( 'CHILD_THEME_URL', 'http://www.fingerprintdigitalmedia.com/' );
define( 'CHILD_THEME_VERSION', '3.0' );//* Enqueue Lato Google font
add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
function genesis_sample_google_fonts() {
wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:300,700', array(), CHILD_THEME_VERSION );
}//* Remove Genesis Favicon
remove_action('wp_head', 'genesis_load_favicon');//* Add HTML5 markup structure
add_theme_support( 'html5' );//* Add viewport meta tag for mobile browsers
add_theme_support( 'genesis-responsive-viewport' );//* Add support for custom background
add_theme_support( 'custom-background' );//* Add support for 3-column footer widgets
add_theme_support( 'genesis-footer-widgets', 3 );//* Remove page title for a specific page (requires HTML5 theme support)
add_action( 'get_header', 'child_remove_page_titles' );
function child_remove_page_titles() {
if ( is_page( )) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}/** Register Widget Area */
genesis_register_sidebar( array(
'id' => 'widget_before_content',
'name' => __( 'Homepage Below Menu' ),
'description' => __( 'This is below the bottom menu of the homepage.' ),
) );/** Add Slider Widget Area */
add_action( 'genesis_after_header', 'widget_before_content' );
function widget_before_content() {
echo '<div class="widget_before_content">';
dynamic_sidebar( 'widget_before_content' );
echo '</div>';
}/** Register Widget Area */
genesis_register_sidebar( array(
'id' => 'widget_after_post_content',
'name' => __( 'Below Page Content' ),
'description' => __( 'This is below the bottom content of the page.' ),
) );/** Add Slider Widget Area */
add_action( 'genesis_after_post_content', 'widget_after_post_content' );
function widget_after_post_content() {
echo '<div class="widget_after_post_content">';
dynamic_sidebar( 'widget_after_post_content' );
echo '</div>';
}/** Remove Lost Password Link from Admin Screen */
function remove_lost_your_password($text)
{
return str_replace( array('Lost your password?', 'Lost your password'), '', trim($text, '?') );
}
add_filter( 'gettext', 'remove_lost_your_password' );// Note: Add only code below to your functions.php
add_action( 'wp_enqueue_scripts', 'amethyst_load_mobile_nav_script' );
function amethyst_load_mobile_nav_script() {//Add mobile button script to primary navigation menu
wp_enqueue_script( 'nav_for_mobile', get_bloginfo( 'stylesheet_directory' ) . '/scripts/drop-down-nav.js', array('jquery'), '0.5' );
}February 18, 2014 at 7:20 am #90946PhilMurrayParticipanthi Davinder
yes - for all my other client sites that screenshot is exactly what shows up if they log in as EDITOR - as expected
it's only occurred on this specific client site and only since i added , then removed that code form the functions.php file
which is a bit confusing - but maybe it is a plugin conflict somewhere
regards
Phil
February 18, 2014 at 8:30 am #90950Davinder Singh KainthMemberYour functions.php file appear fine, nothing alarming in it. Check by disabling plugins and then create a new user with 'editor' role to confirm on the issue.
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 18, 2014 at 8:53 am #90953PhilMurrayParticipantthanks Davinder
ok - i disabled all plugins - created a new USER with EDITOR status but i still see the APPEARANCE menu option when logged in as the new user?
see screen shot below - the GENESIS menu is also visible
cheers
Phil
February 18, 2014 at 9:02 am #90955Davinder Singh KainthMemberThis isolates problem to theme in question. If website is not in production, can you activate some other genesis child theme (where no modifications were done) and then check on the issue.
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 18, 2014 at 9:10 am #90957PhilMurrayParticipantThanks Davinder
it is strange though because I use this base theme for nearly all my client sites and never had this issue before
I activated the base GENESIS child theme - but didn't seem to make any difference.
Would it be worth my while uploading the wp-admin and wp-includes folders to the server again ?
cheers
Phil
February 18, 2014 at 9:53 am #90973PhilMurrayParticipanthi Davinder,
thanks for you help with this - can't seem to locate the problem at this stage - i have disabled plugins, re-installed wordpress manually, checked the functions.php file etc --- so aside from trying the options you mentioned in the first reply i think I will have to go back to a previous version of the child theme which seemed to be working fine and them add in the additional elements from there.
cheers
Phil
February 18, 2014 at 11:06 am #90993SummerMemberDid you change anything for Editor in Access Control that might be overriding what you'd removed from functions? Other than adding another plugin that manages roles and capabilities and seeing if the Appearance menu is really turned off for Editor on that site, I'm not sure what else other than poking through the database looking at options would be able to help.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 18, 2014 at 11:55 am #91001PhilMurrayParticipantThanks Summer
no - not to my knowledge - the only thing I did was add this code to functions.php
/** ALLOW EDITOR TO MANAGE MENUS */
// get the the role object
$role_object = get_role( ‘editor’ );// add $cap capability to this role object
$role_object->add_cap( ‘edit_theme_options’ );which allowed an EDITOR to see the APPEARANCE menu option -- I tried it as a test to see if it would work and it did.
But when I removed that code and uploaded functions.php to the server the EDITOR can still see the APPEARANCE menu - which is not what i want of course
i seem to have tried everything and disabled plugins etc - without any change -- but I will go through the ACCESS CONTROL plugin settings again just in case something got changed there.
thanks
Phil
February 18, 2014 at 9:51 pm #91060Davinder Singh KainthMemberReverting to previous child theme version that worked and re-uploading wp-admin and wp-includes folders is next logical step. Do update here with results.
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 18, 2014 at 11:47 pm #91087SummerMemberI could be wrong here, but my understanding was that adding and removing capabilities is a one-time thing, not something that has to be loaded each time like other components for the site.
You might have it in your functions, but once it's done the first time, it will stay done until another call is actually made to remove it, so simply removing the function that added the capability won't actually remove the capability from the user role until you actually perform the removal.
Have you tried placing
remove_cap
call in your functions one time, to remove that capability from EDITOR, and see if that fixed things?After that I'd remove it completely from your functions, just to keep things tidy.
update: yep, I was right. This is the info direct from the Codex:
Adds a capability to a role or specific user. Changing the capabilities of a role or user is persistent, meaning the added capability will stay in effect until explicitly revoked.
N.B.: This setting is saved to the database (in table wp_options, field wp_user_roles), so it might be better to run this on theme/plugin activation
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 19, 2014 at 3:47 am #91107PhilMurrayParticipantThanks Davinder and Summer
I will post back here with the results
Phil
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.