• Resolved vitaljik

    (@vitaljik)


    I belive it´s not a problem for most, but I don´t want to have the capability to blog post or even access them in admin menu for a role who will edit the menu. Is it possible to resolve that somehow? I have members plugin installed but custom capability for menu post types is not shoving up. From what I understand it could be something like “fdm-menu” and “fdm-menu-item” Can someone advise?

    https://wordpress.org/plugins/food-and-drink-menu/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi vitaljik,

    No, there’s no custom capabilities defined by the Food and Drink Menu plugin. However, if you’re familiar with WordPress hooks, you can filter the post type arguments to add a custom capability for the menu item post type if you’d like.

    Actually, I’ve just checked the code and I forgot this hook! My mistake. You can add the hook you need into the code. This commit shows you what to add. It’s safe for you to go ahead and modify the plugin file because this change will go out in the next plugin update, so when you update the hook will still be there.

    You’ll need to add the capabilities to the register_post_type() $args array. Justin Tadlock has a helpful guide to the parameters in this array that might be a little easier to follow. Look for the capability_type or capabilities parameters.

    A similar filter, fdm_menu_args, is already in place for the menu post type.

    Thread Starter vitaljik

    (@vitaljik)

    Ok, this is a bit too advanced for me at this moment, but I understand now how this is working. Thanks for your answer.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Only works when capability to post is enabled’ is closed to new replies.