I solved the issue by putting all the actions and filters inside plugins_loaded which fires very early. Like this:
add_action('plugins_loaded', function(){
if ($this->is_user_b2b()){
add_action(.....
add_filter(.....
Related Posts:
- Where is the best place to use add_filter
- How to prevent action in ajax request, when in admin side?
- Get Time Taken By Each Action Hook in WordPress
- Redirect to another page using contact form 7? [closed]
- How to use add_action for multiple instances of the same class
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Nested Actions and Filters
- Remove action added in plugin class from theme
- Help needed with woocommerce (wc stripe) filter
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- When can you get current page ID and initialize hooks right after?
- Using the ‘draft_to_publish’ hook (post status transition)
- How can I limit functionality in one version of a plugin?
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Use external link in the add sub menu
- How to prepend to the_title for admin-side plugin’s use
- How can I filter blog name?
- Can a plugin add to header/footer/body content?
- Custom Shipping method not showing in checkout
- How to filter content post only on save
- Filter or action hook to insert content on admin pages before tag
- Woocommerce Shipping module available only for type of products [closed]
- Add Fields with Sub-Fields to WP Job Manager
- How to call bind function in wordpress actions or hooks
- merging an array to an existing array using add_filter
- template_redirect not being called when using ajax
- Is it possible to set up multistore in Woocommerce? [closed]
- add_action in functions.php, do_action in plugin?
- How to remove the woocommerce_checkout_process action hook in woocommerce if particular project in cart [closed]
- add action for displaying posts using a shortcode
- ‘wp_login’ action hook not working with wp-login.php file
- HTML in WooCommerce settings
- Woocommerce plugin for minimum order and add-to-card-step
- Automatically add attributes to woocommerce product?
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- woocommerce payment gateway callback not firing [closed]
- How to modify WCMP Rest API response?
- White page by using filter template_include
- Woocommerce dependent plugin
- New databes tables with – WooCommerce – for developers [closed]
- Create a navbar filter that filters by a custom field
- Change commission_status paid when withdraw_status vendor is completed
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- Plugin developer automated documentation
- qTranslate remove default directory from link
- Custom plugin init action causing general slowness
- Woocommerce Minimum Price for a Composite Product to add in cart
- WordPress user account activation
- How to change the name of the “edit my profile” link in the WordPress admin backend
- Inject HTML meta tag inside wordpress tag using add_shortcode
- Proper way to replace the_content only for pages created by custom plugin
- Add action to fire when a published post is updated
- How to pass variables to a function argument using add_action [duplicate]
- Check filter defined or not?
- Hook for page Request?
- Editing wp-config.php
- Get Every Key & Value from Array then Display All in New Line
- add seperate suffix for low price and high price in woocommerce
- Error with get_price (and others) in self-written plugin to show price
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- Search users with custom meta data
- Custom CSS not being added by plugin
- apply_filters(woocommerce_get_item_data, …) Causing errors when adding to cart
- How to Get Category Name When Export Products
- Visual composer custom element error
- Using OR Condition with facetwp facets
- How can i solve php upgrade problem
- woocommerce: Customize email with item total count
- show wc_add notices on particular page in woo commerce custom plugin development
- The function called on the wp head hook becomes null
- How to get the checkout form data from checkout page when place-order button is clicked
- How to make WooCommerce multiple filter with custom meta fields
- category page multiple products add to cart any plugin available for woocommerce
- “Enable Media Replace” plugin does not update serialized object in WPMeta
- How to Unhook actions/filters in within Class in plugin
- Change Woo Custom Endpoint Titles from a Plugin
- Use action, filter, or hook to append HTML to WordPress plugin function
- Passing function into add_action always returns the first argument
- Get post content inside plugin class method
- Change hook to add_action in a plugin class
- echo plugin results on pages
- Adding/ Removing actions for plugins
- What action or filter can I use to change all the html returned from server for a page?
- Can I add content before post content without using the_content filter
- Problem with conditional woocommerce custom checkout field
- WordPress Add advertising ads befor and after content with periority [closed]
- Unable to sync woocommerce variations
- trying to create simple plugin to filter categories from all authors
- woocommerce blank page after clicking add to cart [closed]
- How do i get all author posts on custom post type list
- Which filters or actions involve with index page for plugin?
- Unable to show 4 products in a row
- Hook for single product thumbnail
- Which action/filter can i use for a Member Plugin [closed]
- How to create a “plugin” or “block” that can manipulate WordPress DOM in frontend?
- Template selector for woocommerce product
- How to add product thumbnail on orders list on backend?
- Brands Filter Not Working For On Sale Products
- Can we install 3d product configurator into wordpress