3

I have used this code;

$roleObject = get_role( 'editor' );
if (!$roleObject->has_cap( 'edit_theme_options' ) ) {
    $roleObject->add_cap( 'edit_theme_options' );
}

to add menu access for editors.

I have a custom post type 'Masterclasses". That appears correctly in the Administrator's Menu editing page but doesn't appear in the Editor's Menu editing page.

How do I add this?

2 Answers 2

5

As ever, when you know the answer it's maddeningly simple. The custom post types were there all along, together with their taxonomy. All posts are absent from the menu editor and have to be turned on in Screen Options.

I pressed the button and lo, there they were.

2
  • 1
    Thanks, this is non-obvious as hell UX. The CPT boxes do not seem like meta boxes, which you would expect Screen Options to control.
    – lkraav
    Commented Feb 14, 2017 at 19:51
  • 1
    Agree with @lkraav. If items are hidden, a link below the selection indicating how they can be added would be better UX.
    – JJS
    Commented Dec 23, 2022 at 19:31
0

You can try giving capabilities for something like add_cap( 'edit_Masterclasses' )

For more you can refer to this documentation http://codex.wordpress.org/Roles_and_Capabilities#Editor

1
  • Half the problem (when searching for this online) is the confusion between this capability - to edit the custom post type - they already can. What I need is to add the Masterclasses to the Appearance-menu possibilities. Admin can Editor can't
    – Chris Pink
    Commented Aug 7, 2014 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.