The only issue was that the capability was specified incorrectly when using add_options_page()
. The capability should be manage_options
. Note the underscore, no space:
function basic_treehouse_badges_menu() {
/*
* Use the add_options_page function
* add_options_page( $page_title, $menu_title, $capability, $menu-slug, $function )
*
*/
add_options_page(
'Official Tree House Badges Plugin',
'Treehouse Badges',
'manage_options',
'wp-treehouse-badges',
'wptreehouse_badges_option_page'
);
}
add_action('admin_menu','basic_treehouse_badges_menu');
function wptreehouse_badges_option_page() {
if( !current_user_can ('manage_options')) {
wp_die('You do not have sufficient permission to acces this page.');
}
echo '<p> welcome to our plugin page </p>';
}
Related Posts:
- What’s the preferred method of writing AJAX-enabled plugins?
- How to add a shortcode button to the TinyMCE editor?
- How to change a user’s password programatically
- Plugin upgrading: Widget settings
- Create a table in custom plugin on the activating it?
- How would you require and automatically download dependent plugins?
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- Redirect to settings page after install
- What is the correct way for a theme to support plugin UIs?
- How does WordPress determine the primary plugin PHP file?
- translation does not work with text_domain
- Understanding apply_filters
- Editor not displaying dynamically after clicking on the button
- Publish Post After Click On A Link
- Custom url structure for custom template
- Created Widget Not Showing up on Admin Panel
- How to display public user profile with 2 additional fields? (GitHub source code included)
- Action on post publish
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- wp_enqueue_scripts not working inside shortcode
- Handling jQuery Component Collision
- How to make my plugin GDPR compatible?
- Scope for PHP Variables Assigned in functions.php or a plugin
- How to make a custom field as an editor in wordpress?
- Why is an action callback function from an instance of a class always invoking the same function from an instance?
- How to keep users unique id stored in session in addition to IP in WordPress plugin?
- JS Support Ticket – Auto create WP account
- uninstall.php file in Plugin to clean DB
- Save / Show multi line text in metabox
- Python with wordpress plugin
- Passing an array from shortcode-function to filter-function
- WP_Async_Task doesn’t appear to be running asynchronously
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- TinyMCE Styles Dropdown not adding html tags other than span
- add_filter doesn’t work
- How can I insert thousands of Woocommerce products by batch with PHP? [closed]
- What are the Best Practises When Using AJAX in Plugin Development?
- Setup wp_schedule_event within a custom plugin
- Run function on plugin activation before plugin is loaded
- execute function after one completed
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- Can I use register_settings and unregister_setting once the settings page has loaded?
- How to Resize the Custom Post Images?
- Why is it important to check for isset and is_array before checking in_array in this example?
- Upload files to the plugin menu
- Class or function wrapper for plugin code
- How to call external functions from a PHP script in a WordPress plugin?
- Licensing a Plugin [closed]
- Add a function call after content automatically?
- Don’t load the theme for a page FROM a plugin EDITED
- WordPress Feed Creator Name Tag Full Name Instead Of First Name
- WordPress plugin with its own “site”/theme
- How to add custom function to pluggable.php
- Ajax request sends url rather than data
- How to displaying Custom image, text and default image logo from Redux Framework option panel
- Security of a WordPress Plugin
- Grouping imported products and showing variations based on selected product
- Remove Zero Money From Previews Order woocommerce
- How to display the category name in the tab and post inside the tab in WordPress?
- How would I Redirect an existing WooCommerce customer to a specific url after Checkout
- Access remote SFTP server via WordPress login?
- Shortcode do not return the right data in post
- Ultimate Members Default Post Layout problem
- best way to upload a large file to wordpress using wp all import
- Why do actions with class and public method don’t fire __construct()
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- How to define the slug for my custom plugin?
- Avoid WordPress header bar when form submission using admin_post in the frontend
- Set “Open in New tab” as default option
- Generate and send ICS file through WordPress
- Field salespeople task management
- Is it possible to create duplicate post on other site (either push, on publish, or pull, periodically)?
- Echo custom admin field into a is_single()
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- Hide ‘add to cart’ button for some products [duplicate]
- Widget outputs the value but doesn’t save anything inside the textarea
- Exclude specifed files from plugin editor
- Add Flatr button to Sharing option
- Change localization only for plugin
- How to get author developer link on plugin page
- wp_schedule_event need to deactivate plugin changing recurrance
- A more elegant way to handle notices/warnings
- Redirect default login page to a custom page [duplicate]
- appointment plugin doesn’t display all appointments
- Display_rows() and column_cb() strange behaviour
- Doing action based on input from options menu
- Create New Admin Menu Section – Like how custom post type works, in a way
- Customize Multi-Column Tag Map to fetch specific post-type
- Combining JS files to one script
- What are the downsides of using bootstrap in plugin development?
- How to generate a responsive output from plugin?
- The plugin generated xxx characters of unexpected output during activation
- Upload Image to desired directory through plugin
- How can I delete the options from DB when the plugin is deleted?
- add_meta_box showing blank screen in my page
- is_user_logged_in() undefined at shutdown in plugin context
- What are Seeds? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- Plugin translations are not loaded from translate.wordpress.org
- Use inline callable for hooks and filters