• Resolved bkjproductions

    (@bkjproductions)


    I’d like to grant access for the Editor level user to this plugin’s settings. Currently only the Admin can edit Tickers.

    I know you have answered this question before, by suggesting to install the Members plugin, but is there simply some sort of hook or a few lines of code we could add to the theme’s functions.php or something?

    To install a whole ‘nother plugin just for one feature is a bit excessive.
    (Frequently, when trying to get support from any particular host with WordPress, they tend to look at the installation and say “You have too many plugins running!”)

    Nice plugin, though! Would probably pay for a premium version if it supported user-level control like this.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author metaphorcreations

    (@metaphorcreations)

    You could use https://codex.wordpress.org/Function_Reference/add_cap

    Example:

    
    function add_theme_caps() {
        // gets the author role
        $role = get_role( 'author' );
    
        // This only works, because it accesses the class instance.
        // would allow the author to edit others' posts for current theme only
        $role->add_cap( 'edit_others_posts' ); 
    }
    add_action( 'admin_init', 'add_theme_caps');

    These are all the capabilities granted to admins:

    “edit_ditty_news_ticker”
    “read_ditty_news_ticker”
    “delete_ditty_news_ticker”
    “edit_ditty_news_tickers”
    “edit_others_ditty_news_tickers”
    “publish_ditty_news_tickers”
    “read_private_ditty_news_tickers”
    “delete_ditty_news_tickers”
    “delete_private_ditty_news_tickers”
    “delete_published_ditty_news_tickers”
    “delete_others_ditty_news_tickers”
    “edit_private_ditty_news_tickers”
    “edit_published_ditty_news_tickers”

Viewing 1 replies (of 1 total)
  • The topic ‘Allow non-Admin users to control settings’ is closed to new replies.