I don’t know if you solved this, I just had same problem,
Second argument in do_action
has special check if it is array with only one object,
In that case they use reference to object in array instead of array with object. I believe they use this method to pass and preserve reference through function with variable arguments.
I used do_action_ref_array()
to avoid this.
Related Posts:
- Problem:Save Several Duplicate posts in The Database and then Error nesting level of ‘100’ reached
- Adding the hook ‘vc_before_init’ inside a object
- Using several add_action with parameters inside a class
- How can I unhook this action that was added via $this?
- Remove an action added within a class in a WordPress plugin
- Why is this require statement not working?
- OOP – add_action
- Using add action for class with construct
- Remove parent theme action in child
- How to do_action and get a return value?
- Remove an action from an external Class
- Using Ajax with a Class file
- Does an activated plugin automatically mean its methods are available to other WP functions?
- How do I enqueue a script to run inside the Gutenberg editor?
- Why, Where, and When to use reference pointers in filters/hooks?
- Autogenerate wordpress shortcodes using array?
- add_action customize_register not working
- Passing arguments into ‘init’ function
- Add a Custom Field in Comment Box AFTER text area BUT BEFORE Send button
- Using wp_insert_post and post_update_meta but need to fire save_post afterward
- How to remove an action that is added inside a class
- PHP5, Inheritance, Singleton – action & filter hook limitations
- Having an add_action( ‘user_new_form’,) [closed]
- How to remove an action added by a child theme of Genesis
- How to add a checkbox inside the “Publish post” widget?
- Ajax Request not coming back to class
- What’s the usage of action do_meta_boxes?
- How can I invoke an action after a CiviCRM triggering event?
- Remove action from a plugin class
- how can I use add_action with external class which the function contain 2 argument?
- remove_action not working with procedural function
- Woocommerce Change placement with wrapper
- Modify query in pre_get_posts action is messing up my nav menu
- Exclude trash from save_post
- Which action fire in front-end single post only
- where is the documentation for add_action() parameters?
- How to manage arrays from custom functions stored in functions.php?
- how can I use add_action run another function when publishing new post?
- How to remove function?
- Validate form in functions.php, send errors back to template
- What is the callback sent to add_submenu_page() invoked by WordPress?
- How to track post number on the_loop
- How can I trigger actions manually?
- $GLOBALS[‘hook_suffix’] variable empty
- publish_post action hook not working
- add_action() in switch statement
- Problem with get_the_excerpt when using an add_action(‘the_content’) containing script tags
- Gutenberg – Dispatch action or setAttributes() on Post Save/Update action instead of onChange listener
- Using Nested add_action()
- WordPress action admin_post for non-admin authenticated users – Form submission
- Instantiating classes through add_action and saving them to user_meta data [closed]
- Are the hooks in the dashboard such as “load-$page_slug$” and “admin-head-$page_slug$” reliable and consistent throughout installs?
- add_action and do_action
- How to call a static function in add_action() inside another static function?
- Add “add to cart” button in WooCommerce [closed]
- remove_action: how to access to a method in an child class?
- Gravity Forms parameters return 1
- cannot filter after using pre_get_posts
- Generate payment URL in custom email [closed]
- Why is my css and js not enqueued until footer?
- missing argument 2 when passing arguments to add_action
- comment_post callback function: how to run it in the background.
- Add new users to “add new user” page on admin’s dashboard
- W3TC manual cache flush does not work
- Run a function on all posts
- add_action( ‘publish_pelicula’, ‘post_published_notification’, 10, 2 ); does not trigger propperly
- add_action.. will work if function is empty?
- save_post not triggered when a post is updated
- Action ‘init’ function doesn’t return variable
- Trying to write a function in an external php file to manage admin menu visibility
- Insert Google authorship into WordPress header
- Action inside another action not working
- How can I get more out of `$post` in an `add_action` callback?
- WordPress sent multiple requests on update
- do_action in API call
- Add Tag to post after publishing
- Remove action not working in child theme
- Call to Action Button – Resize Help [closed]
- How do I dequeue js/css at the last possible moment?
- Pass an argument into a function to extract from array
- wpdb->insert creates duplicate rows
- Remove action from plugin
- Need data from two different actions
- Adding a conditional to work on certain pages/page templates to an add_action()
- Adapting functions from Genesis theme
- Adding add_action function
- Object oriented programming, add_action in constructor not firing
- XML Imported Custom Posts
- Invoke a function before the action hook
- save_post action not firing when save
- WooCommerce wp_insert_post action firing on every save
- How to enable/disable a hook with theme options
- Passing arguments in add_action inside search template
- Building WP Web App: Creating a Feed for post revisions
- Can admin_bar_menu or another action be used to modify the admin bar on the admin side?
- OOP Plugin: Where should I place the action hooks in the class?
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- remove an action hook function on a plugin from a theme
- Is it possible to make get variable out of filter in Class?
- What is the first action or filter executed by wordpress?