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?
- Custom fields in the billing address section woocommerce
- how to execute a function only when i send an order to trash [closed]
- Are woocommerce_thankyou hook and is_order_received_page() redundant? [closed]
- WC REST API Error Handling
- functions won’t fire after I converted my code from procedural code to OOP
- How do I ensure I can loop through every enqueued script and CSS?
- Hook for validating and rejecting frontend image upload
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Nested Hooks with do_action for performance reasons – safe/necessary?
- How do I remove an action hook inside a class that is called by another class?
- Pre-populated WooCommerce checkout fields: dropdown fields issue
- Woocommerce Product finder feature on home page
- want to confirm popup with “Yes” and “No” button when user click on add to cart
- Problem in plugin debuging in wordpress
- How to remove the WooCommerce Product->Category thumbnail from admin [closed]
- Woocommerce Single Product Tabs Got Duplicate
- Performing ajax request in wordpress
- Woocommerce product not appearing in category list page when created programatically [closed]
- Error when activating a custom plugin on production server
- woocommerce wc_get_product is not fetching all the product of particular category
- Override WooCommerce files from plugin
- woocommerce add a new bulk action in the bulk actions dropdown in the orders list
- How to trigger WooCommerce user profile edit change?
- Add suffix to price html does not work
- How to set a public variable in someone else’s plugin class
- Plugin Development – Call to undefined function comment_exists()
- Override theme’s WooCommerce file
- With what hook do I remove WooCommerce existing Product Data Tab form fields?
- WC_Geolocation not found inside plugin
- Redirect theme directory to plugin theme directory
- remove different admin menu for specific users
- Change Front page displays settings conditionally when user is online
- How to use functions from Woocommerce documentation?
- login_message filter not working
- How to Maintain url on form submit
- replacing jquery google cdn with a new version dynamically
- Prevent plugin activation and add admin notice
- external Integration with wordpress timeout error
- I have a plugin where in I have to change the title of the page dynamically by sending parameter to the_title filter
- WordPress Dropdown image select
- Modify search form with plugin
- Handle changed Woocommerce function
- How and when would I implement some code which would take data from one part of the Db and put it in another?
- Making Woocommerce optimized for more than 500k products
- How is construct function working even when variable is assigned null value?
- Single_template for a custom post type created from a plugin is returning an empty page
- get_comment_meta() for a filter hook in a plugin
- add_option_{$option} action hook not being called
- Unable to show a message after plugin activation