Friday, December 9, 2022
HomeWordPress Developmentphp - Make plugin admin web page seen to different roles

php – Make plugin admin web page seen to different roles


I’ve created a plugin that I would like customers with the position of ‘Editor’ to have the ability to see and use of their admin panel.At the moment, solely directors can see and use this plugin.

I imagine it has one thing to do with the capabilities, however I’m uncertain of how or the place to make the required adjustments. Any assist can be tremendously appreciated.

My present plugin

/**


* Plugin Title: Nanme
 * Plugin URI: uri
 * Description: desc
 * Model: 2.2.1
 * Creator: me
 * Creator URI: uri
 * Requires at the least: 5.8
 * Requires PHP: 7.2
 * Textual content Area: wcrb
 */

add_action( 'plugins_loaded', 'wcrb_init' );

operate wcrb_init() {
    load_plugin_textdomain( 'wcrb', false, basename( dirname( __FILE__ ) ) . '/languages' );
}

add_action( 'admin_menu', 'wcrb_report_page' );

operate wcrb_report_page() {
    add_submenu_page(
        'woocommerce',
        __( 'Betalingsmetoder', 'wcrb' ),
        __( 'Betalingsmetoder', 'wcrb' ),
        'manage_options',
        'payment-gateway-report',
        'wcrb_report_page_callback'
    );
}

operate wcrb_report_page_callback() {
    echo "instance";
}

That is principally my plugin. I reduce out the delicate information in there.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments