WordPress.org

Ready to get started?Download WordPress

Forums

User Role Editor
Add new capability in a plugin (2 posts)

  1. DarioDN
    Member
    Posted 2 years ago #

    I would edit the "quotes collection" plugin (or others) to add a new capability defined in URE.
    So, first I added a new role "quote_collection".
    Then, in the plugin I edit the code as follow:
    from
    add_action('admin_menu', 'schedeais_admin_menu');

    to

    if (current_user_can('quote_collection')) {
    	add_action('admin_menu', 'schedeais_admin_menu');
    }

    But, when I reload the wp-admin this error appears:
    Call to undefined function wp_get_current_user() in /home/server/site/wp-includes/capabilities.php on line 1028

    So, someone can help me to add a capability to a plugin?
    tnx

    http://wordpress.org/extend/plugins/user-role-editor/

  2. blokof
    Member
    Posted 2 years ago #

    I like to know to!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic