add_action not running when do_action is called
-
In bp-groups (@ line 1560) is the line
do_action( ‘groups_new_forum_topic_post’, $group_obj->id, $forum_post );
I’ve created a function –
function my_notification_new_post($groupid, $mypostarray)
in a file that I placed in the mu-plugins folder. That file is basically:
function my_notification_new_post($groupid, $mypostarray) {
stuff happens here;
}
add_action( ‘groups_new_form_topic_post’, ‘my_notification_new_post’ );
But, when a new post is created, my function isn’t getting called.
However, if instead of having the add action, I hacked bp-groups.php to look like:
do_action( ‘groups_new_forum_topic_post’, $group_obj->id, $forum_post );
my_notification_new_post($group_obj->id, $forum_post);
My function is called and works great. What am I missing???
- The topic ‘add_action not running when do_action is called’ is closed to new replies.