Home Forums Weaver and Plugin Interaction Action and Filter function not doing anything

This topic contains 2 replies, has 2 voices, and was last updated by  booth1 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #57712

    booth1
    Participant

    Hi all,

    I am using the Wp-members plugin and I am trying to send my users to a certain URL when they click log out. The developer gave me the following code to input and I added it to the Actions and Filters area in Weaver Xtreme Plus. I am running latest WordPress and latest Weaver Xtreme. Appreciate any help as I really haven’t got a clue why this isn’t working. The developer says something else must be jumping into the process.

    add_action( ‘wp_logout’, ‘my_logout_redirect’, 1 );

    function my_logout_redirect() {
    // return the url that the logout should redirect to
    wp_redirect( ‘https://ally-law.com/referral-reporting’ );
    exit();
    }

    Appreciate any help getting this to work!

    #57716

    Weaver
    Keymaster

    Your example uses backticks (`) instead of single quotation marks (‘).

    But even fixing that doesn’t seem to make it work. I don’t understand exactly why this doesn’t work. I even tried this code as a direct addition to the theme’s functions.php, and it still doesn’t work.

    BUT: use this plugin instead. It works, and provides more flexibility. (After activating the plugin, the settings are found on the dashboard Settings -> General menu.)

    https://wordpress.org/plugins/login-and-logout-redirect/

    #57721

    booth1
    Participant

    Awesome! That works perfectly thank you so much!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.