• Resolved Marc

    (@arbolife)


    Hi,

    I use a modal login form from my theme rather than wp-login.php. How can I change that in your plugin without hacking straignt into the code? Right now I changed the function usp_login_required_message() at the bottom of user-submitted-posts.php to have this line:

    $message .= ' <a class="kleo-show-login" href="#">'. esc_html__('log in', 'usp') .'</a> ';

    instead of:
    $message .= ' <a href="'. wp_login_url() .'">'. esc_html__('log in', 'usp') .'</a> ';

    Thanks,
    Marc

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Hi Marc,

    You can use the provided hook to filter the login message. It’s located in /user-submitted-posts.php around line 1171:

    apply_filters('usp_require_login', $message);

    • This reply was modified 7 years, 6 months ago by Jeff Starr.
    Thread Starter Marc

    (@arbolife)

    Hi Jeff,

    Thanks, I missed it. In case someone has the same need here’s what I added to my functions.php:

    add_filter('usp_require_login', 'kleo_modal_login_usp');
    function kleo_modal_login_usp($output) {
        $output = preg_replace('/<a([^>]+)href=\"http\:\/\/([a-z\d\-]+\.[a-z\d]+\.[a-z]{2,5}(\/[^\"]*)?)\">/i', '<a class="kleo-show-login" href="#">', $output);
        return $output;
    }

    Thanks,
    Marc

    Plugin Author Jeff Starr

    (@specialk)

    Cool thanks for sharing your solution, Marc.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing login link’ is closed to new replies.