WordPress.org

Ready to get started?Download WordPress

Forums

BAW Login/Logout menu
Additional Menu Items (10 posts)

  1. TF28
    Member
    Posted 1 year ago #

    Hi There,

    First thanks for the great plugin! I would suggest to add all the buddypress menu items or give the chance to add menu item with my own php code myself.

    Cheers, TF

    http://wordpress.org/extend/plugins/baw-login-logout-menu/

  2. peripatew
    Member
    Posted 1 year ago #

    I'm using another plugin in conjunction with this one. Peter's Login Redirect: http://wordpress.org/extend/plugins/peters-login-redirect/

    In his notes section of the plugin, he mentions a "login portal" function of the plugin. I know the php required to call that, but can't add it in as a menu item like this plugin does.

    Could there be a way to add in custom PHP options that get pulled in as menu items like you have done?

  3. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    Hello

    you both want to add your own menu item coded with php ?
    Explain me your need, why coded in php and not hardcoded/added in custom menu ?

    Thank you

  4. peripatew
    Member
    Posted 1 year ago #

    I'm using the plugin mentioned above. I need to insert this:

    `<?php rul_register(); ?>

    in as a menu item so that it will call that on click. I searched and couldn't find a way to have it do such. Perhaps there is an easier way to accomplish a similar thing? Sorry for my lack of coding knowledge.

  5. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    Can you tell me more about this function ? Where does it come from ?

  6. peripatew
    Member
    Posted 1 year ago #

    Yes, it comes from: http://wordpress.org/extend/plugins/peters-login-redirect/

    Here's the relavent bit from the plugin page:

    Custom "My Portal" link
    A common need is to display the "redirect" link for a user in the site navigation or sidebar.

    Look at the function rul_register() in the plugin file for inspiration; it makes use of the redirect_to_front_page() function to determine the URL and then provides the relevant output code.

    For a deeper dive into this feature, please see this video: http://www.screenr.com/Gqi8

    Basically, I'm trying to create a link, which will use Peter's Login Redirect plugin to send user's to specific pages. I need them to click on a link in the menu though, which then call's the function in his plugin. Here's the function from the plugin:

    function rul_register( $before = '', $after = '', $give_echo = true ) {
    global $current_user;

    if ( ! is_user_logged_in() ) {
    if ( get_option('users_can_register') )
    $link = $before . '' . __('Register', 'peterloginrd') . '' . $after;
    else
    $link = '';
    } else {
    $link = $before . '' . __('My Alpha and Omega', 'peterloginrd') . '' . $after;;
    }

    if ($give_echo) {
    echo $link;
    }
    else {
    return $link;
    }
    }

    I tried modifying your plugin, and was successful in adding in a #bawcustomp#, but his plugin adds additional formatting the breaks the menu's hyperlink.

  7. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    Ok i understand, you need a kind of "new" login and logout pages, custom one right ?

  8. peripatew
    Member
    Posted 1 year ago #

    Yes!

  9. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    Ok ok, so you have to clone my plugin OR i can add a filter on each link then you could just hook on it.

  10. peripatew
    Member
    Posted 1 year ago #

    A filter would be a great solution, would I just add in my code somewhere?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.