• Resolved Arteyin

    (@arteyin)


    When I am on my editor account using my plugin and I try to save settings, it gives me the error Cheatin’ Eh unless I am on my admin account. I have read that this is due to not having correct permissions, but I have tried different roles and capabilities and it still will not work unless I am an admin.

    As an editor, I am still able to do the tasks such as edit pages but setting the $capabilities to edit_pages do not work. I can still edit other plugins that are editor-enabled

    add_menu_page('Title', 'Title', 'edit_pages', basename(__FILE__), array(&$wb_plugin, 'wbInitPlugin'), 'dashicons-admin-tools');
    function wbInitPlugin(){
    			global $wb_plugin_options, $wpdb;
    			?>
          <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
    			<div id="wrapper">
    				<h2>Twitter Live Feed Settings</h2>
    				<form method="post" action="options.php" enctype="multipart/form-data">
    					<?php settings_fields('wb_plugin_options'); ?>
    					<?php do_settings_sections(__FILE__); ?>
    					<p class="submit">
    							<input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes'); ?>" />
    					</p>
    				</form>
    			</div>
    			<?php
    
    		}
Viewing 1 replies (of 1 total)
  • Thread Starter Arteyin

    (@arteyin)

    add_filter( 'option_page_capability_wb_plugin_options', 'wb_plugin_options_capability' );
        function wb_plugin_options_capability( $cap ) {
            return 'edit_pages';
        }
Viewing 1 replies (of 1 total)
  • The topic ‘Cheatin' Eh on custom plugin’ is closed to new replies.