Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to redirect after a user has posted an update in “Group Activities”?


  • michaeldenmark
    Participant

    @michaeldenmark

    I have inserted this code in bp-custom.php:

    <?php
    function my_redirect() {
    wp_redirect( home_url() );
    error_log(‘Hello log’);
    exit;
    }
    add_action( ‘bp_groups_posted_update’, ‘my_redirect’ );
    ?>

    Writing is done to the log file, but there is no redirect after a user has posted an update in “Group Activities”. Why not?

    As a test, if I use “wp_redirect( ‘https://buddypress.org/&#8217; );” instead of “wp_redirect( home_url() );” and use the action hook “init” instead of “bp_groups_posted_update”, and press F5, I am redirected to https://buddypress.org/.

    I use the latest version of WordPress and BuddyPress.

    BuddyPress is the only plugin activated.

    WordPress is installed in a subdomain.

    My issue still happens with themes Twenty Twenty-One, Twenty Twenty-Two, Twenty Twenty-Three and Twenty Twenty-Four.

  • You must be logged in to reply to this topic.
Skip to toolbar