It seems if you use classes you have to use array($this, $function)); in the function element as shown below.
add_submenu_page( $mainmenu_slug, $submenu_title, $submenu_label, $capability, $submenu_slug , array($this, $submenu_function) );
Related Posts:
- wp_enqueue_script was called incorrectly
- Remove type attribute from script and style tags added by WordPress
- How to display error messages using WP_Error class?
- Remove Menu Page Giving Error
- Functions.php reverted to new one
- Why is my Gutenberg block returning an error after initial save?
- Debugging with functions.php
- Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images
- Parse error after modifying the template menu [closed]
- help I changed one currency in woocommerce and everything is ruined [closed]
- Need help getting a function to function
- Connecting to a 2nd DB gives me no results when querying
- debugging errors.. how to remedy?
- Functions Error: Impacting Galleries
- Strange error from functions.php files (wp_register_script)
- Show errormessages on wrong username/password on custom loginform?
- Problems with functions.php! Error! [closed]
- Looking for Functions File that doesn’t Exist
- functions.php pharse error on complete new install
- “Conditional query tags do not work before the query is run. Before > then, they always return false. “
- MCAPI.class.php showing some error
- I’m getting invalid taxonomy in init action
- Translation Function missing text-domain [closed]
- What is wrong with functions.php? Fills error log with same error
- Random text changing to weird icons in both admin & front end
- jQuery HoverIntent is not a function
- Why does modifying my functions.php file always result in a server error
- Notice: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ in ….functions.php on line 73
- Woocommerce – Checkout error message
- How to fix enqueue_styles error for a twenty-seventeen childtheme
- Comment turned Invisible
- Logout redirect via page template without confirmation?
- Convert Image to Webp on upload without plugin
- Get the ID of the page a menu item links to?
- Different wp_mail_from and wp_mail_from_name for specific situations
- register_post_type for Pages?
- Paged Single Post doesn’t redirect to the main url after Removing Pagination
- Restrict user registration to emails on a single domain
- Call to undefined add_action() in theme’s functions.php
- How can I rename the WordPress AJAX URL? [duplicate]
- How to add a rel attribute to images that contains their categories?
- Can I use require() function in a template file?
- What is the most efficient method for loading widgets in functions.php
- Enqueue script o style only if a template part is loaded
- Can I pass two roles to the function get_users?
- Add external js file to footer with id
- password protected post policy
- Logout hyperlink within a sub-menu
- Manipulate Permalink
- Change the HTML of the comment form that is generating somewhere from the core WordPress
- How to customly read JWPlayer’s “Playlist” items by using its “playlistid”?
- How to get the index number of the posts?
- Removing wp_login_viewport_meta
- Custom Attachment Caption Fields
- Call WordPress function outside of WordPress
- Move Custom Fields on General Settings Page to New Location
- Remove adjacent_posts_rel_link under 3.2?
- enqueue_script with filemtime javascript not working
- WP function won’t work on 404 template page
- How to obtain the recent posts without their content in an efficient way?
- Limit dimensions of “Full” size images
- Where to put random functions?
- Define PHP variable from a seperate API if statement
- Auto-Tweet if Type is ‘Status’ using OAuth
- Output a specific link in WordPress post if the single post’s category’s name contain certain word
- Passing user enetered value in widget: number of words, for example
- Adding a section in line at the end of the main navigation menu in php
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- Suggest Users basing on User taxonomy
- update_post_meta is Updating with two page id
- Custom Image Size in Insert Media
- Custom Menu in Admin doesn’t change menu in browser
- sort metabox columns in listing Single
- wp_nav_menu displaying all pages
- Why should I use get_template_directory() when include files?
- How to display an image before title text in menu items
- Error in “class-wp-hook.php”
- How to replace ACTION url from original wordpress login form?
- Redirect User Role When on Specific Page
- How to force one script to load before google tag manager script
- Ajax in plugin fails – but only on one blog – no idea why
- I can’t in any way include css in my theme using functions.php
- Problem with email function
- admin-ajax.php 403 forbidden only when calling from external file
- Remove post from latest posts after a month only with certain tag
- Display list of pages that contain a certain string within the slug
- I need to completely ‘wp_dequeue_script’; what’s the best way?
- $content is empty while using DOMDocument
- Change the second role depending on the first
- Problem with add_rewrite_tag
- Modify function Shortcode_atts
- Full size image option removing problem
- Add custom fields after post/page title
- Ajax call does not work for this custom code
- Force resize for all video content
- Way of getting queried loop before the query with a filter hook?
- Add the title of a widget as an ID – for anchor links
- Need to use an external variable inside a function
- Correct php syntax to add an image in wp functions.php
- woocommerce_sort_product_tabs() expects an array