Login Widget

This topic contains 5 replies, has 2 voices, and was last updated by Avatar Pie Register 3 years, 10 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10003901
    Avatar
    Andrea Bettelli
    Participant

    Hi,
    Thanks, really, for this great plugin!
    Could I know, please, after logging in, how can I have, in the widget:
    If I am the Administrator … the 3 lines with the links for: Dashboard – New Post – Logout
    If I am a Member … the 3 lines with the links for:: Profile – New Post – Logout

    Thanks
    Andrea

    #10003902
    Avatar
    Andrea Bettelli
    Participant

    Without make difference I chenged with the following lines of code in widget.php:

    
    			echo '<div class="member_div">';
    
                echo '<a href="'.admin_url().'" class="" title="Dashboard">'.__("Dashborad","piereg").'</a></div><br />';
    
                echo '<div><a href="'.site_url( "/wp-admin/post-new.php" ).'" class="" title="New Post">'.__("New Post","piereg").'</a></div><br />';
    
    			echo '<div><a href="'.wp_logout_url().'" class="" title="Logout">'.__("Logout","piereg").'</a></div></div>';
            echo '<br />';
            echo '<br />';
            echo '<br />';
            echo '<br />';
    

    Can be ok this code or have you some other solution?
    Thanks
    Andrea

    #10003904
    Avatar
    Andrea Bettelli
    Participant

    Hi,
    finally I will leave the code for the Login as the following:

    
                if( ! current_user_can('administrator')) {
                echo '<div><a href="'.site_url( "/wp-admin/profile.php" ).'" class="pie_log_in_out" title="Profile">'.__("Profile","piereg").'</a></div>';
            }
        else
            {
                echo '<div><a href="'.admin_url().'" class="pie_log_in_out" title="DAshboard">'.__("Dashboard","piereg").'</a></div>';
            }
                echo '<div><a href="'.site_url( "/wp-admin/post-new.php" ).'" class="pie_log_in_out" title="New Post">'.__("New Post","piereg").'</a></div>';
    			echo '<div><a href="'.wp_logout_url().'" class="pie_log_in_out" title="Logout">'.__("Logout","piereg").'</a></div></div>';
                echo '<br />';
                echo '<br />';
                echo '<br />';
                echo '<br />';
    

    Good night
    Andrea

    #10003916
    Avatar
    Pie Register
    Participant

    Hello,

    Thanks for your question.

    Well, you can do it programmatically.

    PR gives you pie_profile_username_frontend_widget filter that passes 3 arguments
    $profile_text_html,$profile_link,$profile_text

    $profile_text_html = ‘‘ . $profile_text . ‘‘;

    You can retrieve logged in users info by calling the following:
    global $current_user;
    get_currentuserinfo();

    Hope this helps

    Thanks

    #10003922
    Avatar
    Andrea Bettelli
    Participant

    Hi Hasnain Abbas,
    Thanks for your reply …
    My question was only about the missed links on your widget for open the dashboard or directly a new post.
    Actually you have only active the link for open the profile.
    Andrea

    #10003934
    Avatar
    Pie Register
    Participant

    Perhaps we will add more links on the widget in our future release.

    thanks

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

The forum ‘Pie-Register 2.0 Support’ is closed to new topics and replies.

Checkout
0
PURCHASE NOW