Because these are not the same, and mean different things:
array( $this, 'method' )=$this->method();array( 'classname', 'method' )=classname::method();
One calls a method on an object, the other calls a static method on a class.
Since what you’re trying to unhook is not a static method, you need a reference to the object, hence why your second example works, and the first doesn’t.
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?
- WP Rest API: details of latest post including featured media url in one request?
- How do I exclude plugins from getting automatically updated?
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- How to disable Gutenberg editor?
- WordPress apply_filters() Arguments Missing
- Filter Hook on plugin update
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Removing user contact methods works from functions.php but not from a plugin
- Use external link in the add sub menu
- Is there any multiple filter/criteria plugin for wordpress? [closed]
- How to prepend to the_title for admin-side plugin’s use
- How can I filter blog name?
- why does the add_action(‘the_content’) overwrite my page
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- There’s some way to add a wrapper around posted images?
- plugin_action_links_{$plugin_file} hook not in the main plugin file
- Creating search filter through plugin
- Woocommerce Shipping module available only for type of products [closed]
- Add Fields with Sub-Fields to WP Job Manager
- merging an array to an existing array using add_filter
- add_filter the_content in functions.php not working
- locate_template with multiple categories?
- Gutenberg Blocks – Change EDIT part of the block using editor.BlockEdit filters. How to change the markup?
- WP Job Manager Category Drop-down; Change Placeholder Text Via Filter
- Randomize attachment IDs
- Pass info from functions.php to plugin
- WordPress Social Login > Post to a users Facebook wall
- add_query_arg not working
- Change permalink structure hidden button edit
- White page by using filter template_include
- How to check current user before all actions and filters?
- Create a navbar filter that filters by a custom field
- Filtering WooCommerce Orders by Category
- How to remove plugin metaboxes from edit.php
- Plugin developer automated documentation
- qTranslate remove default directory from link
- Output content to the_content before a plugin does
- Is there a hook to Intercept al urls from a webpage and redirect to a page
- Filtering get_permalink in Jetpack / ShareDaddy
- Proper way to replace the_content only for pages created by custom plugin
- Redirect to another page using contact form 7? [closed]
- Is there a way to figure out which action/filter invoked a function?
- Add sub menu page in your plugin
- Check filter defined or not?
- How can I apply a WP filter on specific plugin version
- Editing wp-config.php
- How to use the pre_option filter before a plugin loads?
- Change text string in a plugin
- How to use filter to disable adding a product to wishlist?
- correctness of URL
- WordPress: Add custom add_filter for custom functions
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- How do I change where a plugin pulls updates from?
- How to have free shipping for WooCommerce Membership members
- How to use apply_filters?
- Hook for altering the content of all wp mails
- what is the point of telling add_filter how many parameters you want passed to the function?
- Filters on the_content with plugins, pages and shortcode
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Filtered content appears in the excerpt
- Want to create custom design of progress indicator in wpforms
- Use a hook or filter, or overwrite this Gamipress function?
- Randomize post (and page) IDs on generation
- Making a list that can be filtered by category/tags
- How to use third-party SendGrid Email Validation API in Gravity Forms?
- how can I edit the HTML of yith ajax product filter
- How to Unhook actions/filters in within Class in plugin
- Nested Actions and Filters
- Use action, filter, or hook to append HTML to WordPress plugin function
- Customize plugin’s output: filters or setters: looking for an advice
- Customize plugin templates
- ACF Taxonomy search on backend (Relationship field)
- Can I add content before post content without using the_content filter
- Add Filter to get_next_posts_link
- Jetpack Comments Change Placeholder Text
- shortcode which is introduced into entry the blog, and appears in side bar
- apply_filters to content but ignore shortcodes
- Use of apply_filter in plugin/widget class
- getpost content with all formatting for admin pages
- making a glossary with wordpress
- Which filters or actions involve with index page for plugin?
- How to add different CSS for galleries
- Add a filter to a different custom plugin
- How to add a filter conditionally based on page related Conditional Tags
- WP Members additional fields on user profile [closed]
- Which action/filter can i use for a Member Plugin [closed]
- How to Add Extra Text In WordPress Title Before Post Publish
- How to add product thumbnail on orders list on backend?
- Custom priority with the_content filter based on user input
- filter just a portion of plugin function
- Deactivated a plugin with a filter, but it still enqueues JS files
- Change social icon in twenty twenty three theme
- WooCommerce Attribute Mapping
- Hide attributes based on previous selection
- How to display title, description etc in block images?
- How to customize WP_Error (REST JWT authentication plugin) [closed]