Skip to:
Content
Pages
Categories
Search
Top
Bottom

groups_update_groupmeta() not working from pluglin located in mu-plugins directory

  • I am having an odd problem with the groups_update_groupmeta() function not executing properly from a plugin I am writing that is located in the mu-plugins directory. I have not had any issues with other functions, but for some reason this one does not seem to work. It does not provide an error, it simply fails. I then tried putting my function call in functions.php and it worked fine.

    The only way I was able to get it to work in my plugin was to call it in a function hooked into the init action. This is a problem because I want to run it on the “groups_join_group” action to add some meta data to the group when a member joins it.

    This is the test function call I am attempting to use:

    `groups_update_groupmeta( 10, ‘parent_id’, 8);`

    Has anyone run into this issue before or have any suggestions?

    Thanks

Viewing 1 replies (of 1 total)
  • I just tried two things:

    I moved the function call into a plugin in the standard plugins directory.

    I added this code:

    `echo “Before”;
    print_r( groups_update_groupmeta( ’10’, ‘msoe_student_id’, ‘ARGH23’) );
    echo “After”;`

    Which echoed back:
    Before
    1
    After

    So it appears to be running, but it did not actually update the wp_bp_groups_groupmeta table unless it is called from the init action or somewhere in functions.php.

Viewing 1 replies (of 1 total)
  • The topic ‘groups_update_groupmeta() not working from pluglin located in mu-plugins directory’ is closed to new replies.
Skip to toolbar