Last argument of function add_submenu_page
is the name of the function to call when display the content of the page. As described here:
http://codex.wordpress.org/Function_Reference/add_submenu_page
The right use is:
add_submenu_page( 'antify', 'Plugins', 'Plugins', 'manage_options', 'plugins', 'my_function' );
function my_function(){
echo 'hello';
}
If you want a separate file you can do this
add_submenu_page( 'antify', 'Plugins', 'Plugins', 'manage_options', 'plugins', 'my_function' );
function my_function(){
include plugin_dir_path( __FILE__ ) . 'path/of/file.php';
}
Related Posts:
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How to only hook on Single.php after content?
- do_action and hook methods
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Get Time Taken By Each Action Hook in WordPress
- remove_action not removing add_action from constructor
- How to hook into action/filter call
- Use action, filter, or hook to append HTML to WordPress plugin function
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- change output location of plugin function using a custom hook
- add query string to all pages after user logged in
- How can I see all the actions attached to an “add_action” hook?
- Where is the best place to use add_filter
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- When can you get current page ID and initialize hooks right after?
- Edit plugin without hooks in functions.php
- How can I log a user out of WordPress before the page loads?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- Filter Hook on plugin update
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Hide WordPress Plugin Deactivation Links
- Pass A Value From Outside To A Plugin Variable
- Failed to invoke other hook from the init hook
- Does the ‘nav_menu_css_class’ filter accept 2 or 3 arguments?
- Very stubborn wp_register_script / add_action vs remove
- How to prepend to the_title for admin-side plugin’s use
- why does the add_action(‘the_content’) overwrite my page
- Is it possible to add an action to the currently running action?
- Is it possible to remove this action? (as it’s added just before it’s called)
- plugin_action_links_{$plugin_file} hook not in the main plugin file
- Determine plugin name from within plugin_action_links filter
- How to prevent action in ajax request, when in admin side?
- merging an array to an existing array using add_filter
- What is the purpose of $merged_filters?
- template_redirect not being called when using ajax
- Can I use a method from an existing plugin as an action hook?
- Plugin custom Action Hook not working
- What are the benefit in adding hook in the init() hook?
- Reposition Woocommerce Message
- ‘wp_login’ action hook not working with wp-login.php file
- Where to hook my plugin’s action
- Any hook for pre-plugin-update -either bulk or single plugin update
- Inserting above the comment template
- Insert new user with form submit ‘init’ hook
- How to get all of the activate_plugin action parameters?
- Modifying the comments section through a plugin regardless of theme
- How to check current user before all actions and filters?
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Filtering WooCommerce Orders by Category
- Is there a hook to Intercept al urls from a webpage and redirect to a page
- WordPress user account activation
- External Script Using WP – Hooks / Actions Not Working?
- edit_user_profile and show_user_profile are not firing inside a class
- Template filter for custom taxonomy terms
- Is there a way to figure out which action/filter invoked a function?
- Using add_action before add_filter on a plugin?
- What exactly happens to function argument availability when using a filter?
- Why do plugins often ask to add in to templates?
- Create a post builder skin in a plugin
- How to get menu location in wp_update_nav_menu hook
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Hook for page Request?
- Are there action hooks for comments?
- How to use the pre_option filter before a plugin loads?
- WooCommerce: after install hook
- How to remove a class function from a plugin by using remove_action()?
- Advanced WordPress plugin activation detection
- Add action to custom Function
- Hook for altering the content of all wp mails
- How to use add_action for multiple instances of the same class
- What hook can I use to modify custom post data before it is displayed on the page?
- Edit post image attributes on fly?
- Add hook after content without formatting
- update_option_{$option} not working (do function after options are saved)
- Unpublished Pages Failing To Appear On Custom Path
- Callback hooked to post_updated firing on new posts as well
- Hooking into the HTML header container
- Plugin function in child theme
- Remove action added in plugin class from theme
- {status}_{post_type} does not run correctly?
- Customize plugin templates
- Help needed with woocommerce (wc stripe) filter
- What action or filter can I use to change all the html returned from server for a page?
- Run only on plug-in activation instead of wp_head
- Plugin Hook: Get posts
- Filter for modifying image on upload
- Which filters or actions involve with index page for plugin?
- OOP Plugin: Where should I place the action hooks in the class?
- How wordpress plugin hooks works? [duplicate]
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- Hook automatic_updates_complete to autoupdate plugin
- Change social icon in twenty twenty three theme