Skip to content

Instantly share code, notes, and snippets.

@patrickgilmour
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickgilmour/a107ef95020574b8388a to your computer and use it in GitHub Desktop.
Save patrickgilmour/a107ef95020574b8388a to your computer and use it in GitHub Desktop.
option_page_capability
<?php
/**
* Allow users with capability 'my_edit_settings' to edit the `my_plugin_options` settings of your Plugin
*
* This avoids giving them 'manage_options' capabilities
*
* @category WordPress
* @see https://codex.wordpress.org/Function_Reference/add_options_page
*
*/
add_filter('option_page_capability_my_plugin_options', create_function( NULL, 'return "my_edit_settings";' ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment