Problem lies in this line:
remove_action('woocommerce_before_my_account', array( $this, 'my_packages'));
This won’t remove action registered by parent class, because $this
is a different object in this case, so you won’t remove any action at all.
So how to remove such action? Since you can’t access the same $this
value in your class, you’ll have to iterate through all filters and remove the given one manually.
Here’s a good example how to do that:
Related Posts:
- Woocommerce – Hide a Column in Cart Table
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Difference Between Filter and Action Hooks?
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How Can I Add a Filter to Class Instance Only?
- How do I Make a Theme “plugin-ready”?
- How to modify post content before writing to database?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Is it possible to create an action hook using do_action() within add_action()?
- Hook for post permalink update
- Dynamically Override Fancy Title
- Define a function outside a class and call the function using action or filter hook
- set_sale_price in WooCommerce [closed]
- Synchronize Custom post type tags to WordPress default posts tags
- WordPress Ajax callback function from plugin – OOP
- How do I change the initial quantity of a product in woocommerce?
- WordPress after content Hook & external template part
- Namespaced action and filter tags
- best practice for query string values – get_query_var always empty for my value supplied in query string
- get_current_screen() return null
- how to add custom functionality after woocommerce place order button
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- Can’t get woocommerce_get_price_html to work [closed]
- WordPress custom taxonomy check box to dropdown
- WordPress class, using add_action to call member function does not work
- How to get all queries’s results after they have executed?
- hook filter after the_content on a specific page
- Bind a function with its own argument to show something dynamically after every content
- Hook add_attachment error
- Call to undefined function is_home() or any conditional tags
- Update variable value via add_filter
- Configure WordPress to Generate Scheme-less Relative URLs
- Hide one specific woocoomerce product
- How to find list of all functions bind to a particular hook from my plugin?
- apply_filters() and call_user_func() to define and call a function outside a class
- Limit get_next_post to posts from the same author
- Override woocommerce loop-start.php from theme using plugin?
- Any way, hook to add content right before the “read more” link?
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- OOP development and hooks
- WordPress Reset password Strength set to medium
- Add_action not calling callback function
- how to retrieve post_id under woocommerce_add_to_cart_validation hook?
- woocommerce single product page hook not working
- How do I replace title with my plugin?
- Woocommerce: block user removing cart item
- Apply function on all action hooks?
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Ninja Forms: Front-End Forms, Post ID?
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Admin settings update updating every time home page is hit?
- add_filter OO with parameters
- Does WP fire delete_post when trashed posts are automatically deleted?
- How to remove unwanted panels inside InspectorControls from core blocks in Gutenberg
- function triggered by “manage_users_custom_column” filter not working
- How to add a link to WordPress Plugin install Listing
- get all products of one category
- How to add custom content under plugin row in WordPress admin plugin list?
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- unable to stop loop when using wp_insert_post with publish_post hook
- Is there a Woocommerce hook that fires when applying a coupon but before checking if it’s valid?
- Print value of an array or variable in a payment plugin
- $wpdb -> Batch insert from XML File?
- Applying OO patterns and principles to plugin development
- Using a filter with multiple parameters and $this
- Custom attribute type not displaying terms in edit product – WooCommerce
- Modifying meta tags after doing ajax call in plugin
- How To Change Logout Screen Title
- Replace youtube embed in wordpress
- How can I replace content in the WP Admin area before an admin page is rendered?
- Valid filenames for add_action’s first parameter
- How do I access the menus produced by Dashboard > Appearance > Menus
- How dynamic action login_form_{action} is working
- How to get the post excerpt using post object?
- Add child pages to submenu automatically
- After plugin activation hook
- Run command “composer install” when activating wordpress plugin
- Custom Plugin Options Won’t Update
- OOP plugin not working
- How to get changed post title in my custom plug-in which fires when ‘save_post’ is called?
- Can I attach a plugin via my add_filter callback contents?
- Action / Hook when a new plugin is added
- Getting Post ID at “stylesheet” and “template” hooks
- Is there any way to get post meta from publish_post hook?
- Performing ajax request in wordpress
- Override WooCommerce files from plugin
- login_message filter not working
- Prevent plugin activation and add admin notice
- WordPress Dropdown image select
- Handle changed Woocommerce function
- Making Woocommerce optimized for more than 500k products
- Does WordPress have something like timer hook?
- Template file structure , wordpress hook for altering the template
- post_results filter confused by pagination in sidebar and main section
- How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?
- Send retrieve password notification email with custom HTML email template
- wp_head is not fired from the hook I have used in my plugin
- Do Not Back Up? Is there any accepted way to tell backup and clone plugins to skip a certain file? [closed]