It’s a PHP callback. You need the syntax to keep a reference to the class instance.
Put it this way – if you didn’t have $this
, how does the caller know that getStuffDone
is a method of your class, and not just a regular PHP function? It doesn’t.
Using array( $this, 'getStuffDone' )
says to PHP:
Hey bro, you need to call the method
getStuffDone
on this instance of my class
Related Posts:
- why is translation not working on theme?
- How can i remove all html tags from get_the_content()?
- Using WP_Query – how to display something IF there are no results
- Using file_exists to check file in Uploads
- Is this a hacking script in function.php?
- Rename image uploads with width in filename
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- Problems migrating WordPress to localhost
- Best way of adding CSS which can be manipulated by the user via theme option panels?
- If Statement Post Formats: No post format selected
- PHP contact form returns warning in text widget [closed]
- Executing `createimagefrompng()` from save_post hook (or equivalent hook)
- Delete option value from array using update_option()
- child theme inherticance and php autoload
- Adding dropdowns to the tinyMCE editor
- Theme currently showing thumbnails, how to show full size?
- How can I use wp_insert_comment to write a comment when a post is edited?
- How can I use a modal window to display the current post in loops featured image?
- How to query for pages/post depending on slug?
- How do you add customer capability after Woocommerce purchase?
- Change sign up fee in cart for subscription products WooCommerce
- Only echo item in foreach with highest value [closed]
- How to put a variable in a instance in the widget
- How do I list the child of a child page [duplicate]
- how to remove metadata from the posts of my blog?
- How can I create a list of page titles from custom meta values?
- How to show 50×50 image thumbnail in Related Post
- get a simple array of all of the term names that exist in all taxonomies
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- Is there an error in my code?
- Show categories then when clicked on a category list all sub category and when clicked show all posts in that sub category
- Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme [closed]
- How to save checkbox values for logged in users?
- Cron job update csv, need help solving :-)
- Extend plugin Class through functions.php
- How can I edit the content in index.php? [duplicate]
- Website needs to be opened for wp_mail to work
- How to know where this function definition is declared?
- Is this spyware on my site or a real Java update?
- Conditional Javascript based on WP Version
- Is it best to avoid using $wpdb for security issues?
- Underscore – Self hosted fonts
- Is it possible to return content, and then also continue to do other things?
- Does WordPress create a new Linux user when creating a new WordPress blog?
- How to sent a email outside WordPress?
- How to remove the h6 tag for the entry-category Class
- Can’t add script immediately after the opening tag on login page?
- page-slug.php not working but only for specific slug
- Redirect to a page for only logged in user
- Add 23 hours 59 minutes and 59 seconds to meta key before saving?
- How to turn each phone number within the $content to a telephone link?
- Creating custom page template from existing PHP site
- Processing ajax call to php to insert into mysql database
- Storing content into a custom taxonomy
- WordPress Search
- WordPress pagination not working in search result page
- How to add 3 weeks to the_time() function
- wp nav menu: show submenu below li item
- How to call custom function outside from the admin page?
- Show different size featured images (the_post_thumbnail) for 1st, 2nd and 3rd posts?
- Pagination stays on same page for post category
- I get “Cannot modify header information – headers already sent” when I change my theme
- Fetching review value using wpdb class
- Using some Loop or repeatable fucntion in AJAX and PHP to reduce repeatability
- Woocommerce disable order item link (backend) [closed]
- Create an array with all the links of the years’ archive (of a custom post type)
- Post form – AJAX won’t upload featured image – Plugin development
- Redux option doensn’t seem when include from functions.php
- Set all WooCommerce Products to Simple, Virtual & Downloadable
- Removing links from Grouped products
- get_results() doesn’t fetch the result
- How can i find wrong word in search box and replace with correct word
- admin panel – How to remove “delete” button from category editing page
- Like and Dislike Buttons on Post with Counter – Only allow one click per post per user session
- How to override WooCommerce Order Item Meta with data from Cart?
- Meta query not showing result properly
- How does WordPress rewrite URLS using its PHP scripts
- WordPress add_rewrite_rule
- Help on Wp_query to print an term
- Inserting other fields to existing registration form in a WordPress theme
- How do I generate formatted permalinks as specified in backend options?
- Upload images from one server to an other in wordpress
- List all blogs apart from the current blog and main blog in WordPress Multisite
- PHP drop down menu for my get_category child of
- Issue in url update when using wordpress update query
- How to use Amazon Elastic Transcoder from WordPress using AWS SDK for PHP?
- add_rewrite_rule questions
- Active class not working on custom menu link using add_menu_page
- retrieve wordpress post-meta using php not wordpress functions
- Show items by user_role
- Break a WordPress function to run in patches and re-continue
- Post content not showing some content
- custom data in url
- PHP-Code inside Href-Tag
- How to handle parent and child pages?
- How to create a container in php then customise it in CSS
- Getting a specific “title for a section” only on Startpage?
- how to check elementor is widget is active or loaded
- ask about add_rewrite_endpoint query_vars
- PHP – Having $_SESSION as an array and adding $_SESSION to array