Mod: Login/Register on User and Menu Widget

4.61K viewsGeneral
1

I missed a Login/Register option displaying on that widget when user is not logged in, much better than just a phrase:

‘ Login to see your profile links’.

To do it, as easy as copy that code to user.php, on /plugins/anspress-questions…/widget/user.php

?>
    <div class="ap-please-login">
        <?php printf(__('Please %s or %s.', 'anspress-question-answer'), '<a data-action="ap_modal" data-toggle="#ap-login-modal" href="'.wp_login_url(get_permalink()).'">'.__('Login', 'anspress-question-answer').'</a>', '<a href="'.wp_registration_url().'">'.__('Sign up', 'anspress-question-answer').'</a>') ?>
        <?php do_action( 'wordpress_social_login' ); ?>
    </div>
    <div id="ap-login-modal" class="ap-modal">
        <div class="ap-modal-backdrop"></div>
        <div class="ap-modal-inner">
            <div class="ap-modal-header">
                <i class="ap-modal-close" data-action="ap_modal_close">×</i>
                <h3 class="ap-modal-title"><?php _e('Login', 'anspress-question-answer'); ?></h3>
            </div>
            <div class="ap-modal-body">
                <?php wp_login_form(); ?>
            </div>
        </div>
    </div><?php

substituting it for line 36 that says:

            _e( 'Login to see your profile links', 'anspress-question-answer' );

Sure, there are better solutions, just what I’ve done.