You can try to modify it with the comment_form_defaults
filter:
/**
* Modify the "must_log_in" string of the comment form.
*
* @see http://wordpress.stackexchange.com/a/170492/26350
*/
add_filter( 'comment_form_defaults', function( $fields ) {
$fields['must_log_in'] = sprintf(
__( '<p class="must-log-in">
You must <a href="https://wordpress.stackexchange.com/questions/170490/%s">Register</a> or
<a href="https://wordpress.stackexchange.com/questions/170490/%s">Login</a> to post a comment.</p>'
),
wp_registration_url(),
wp_login_url( apply_filters( 'the_permalink', get_permalink() ) )
);
return $fields;
});
where we use the wp_registration_url()
and wp_login_url()
core functions.
ps: the info on the comment_form_defaults
filter seems to be missing from the Codex.
Related Posts:
- How to retain comment text on comment form after login/registration?
- Change hyperlink to User Registration page instead of WordPress login page
- What should I do to make generated avatars different for anonymous comments?
- How to Block Access to Standard Login Flow and Comment Flow
- Display commenter’s registration date on comments?
- Send Notifications to All Admins
- Registered but Anonymous comments
- Log in link not showing, Comment Issue
- How can I test why the comment hook is not working?
- How can I convert anonymous commenters into registered users?
- All users/comments suspected as bot? [closed]
- Automatically register users with comments
- How to replace anonymous comment form with a registration form on wordpress?
- How do I convert users who put an email and username for a comment into registered users? [duplicate]
- How do I comment out a block of tags in XML?
- R: Comment out block of code
- Check if wp-login is current page
- Why do I get comment spam even with Akismet and Captcha?
- What tools are available for managing/writing to WordPress? [closed]
- How to rearrange fields in comment_form()
- setting comments off as default for pages and custom post types?
- Separate registration and login for different roles
- SSO / authentication integration with external ‘directory service’
- Is it possible to pull comments from facebook into your blog?
- How to prefill WordPress registration with social details
- Filtering the Admin Comments List to Show Only Comments from the Current User?
- Non-threaded comment replies with link to original comment
- Approve comment hook?
- Commenting in user profile page?
- comment_post_ID 0 (cannot remove from dashboard)
- Disable comments on all posts/pages
- How do I delete all comments from a specific old blog post?
- Removing the “Website” Field from Comments and Replies?
- Stop WordPress redirecting comment-page-1 to the post page?
- Importing old Disqus comments into WordPress
- How to add a class to the comment submit button?
- How to wrap submit button of comment form with div
- How to enable comments for pending and draft posts?
- Using WordPress’ WYSIWYG for comments
- Enable Submit Comment Without Page Reload (Using Ajax)?
- What for is the table “wp_commentmeta” exactly?
- WordPress auto login after registration not working
- Getting Post Comments for post ID using WP_Query() and a Custom Loop?
- Add option to disable comments on a per posts basis?
- Resetting comment count
- When importing – failed to import: Invalid post type feedback
- How to change the email notification recipient (user) for new comments?
- Redirect user to a custom url after submitting the comment
- Paginate result set from $wpdb->get_results()
- Woocommerce registration page [closed]
- Change Comment Author Display Name
- Would switching to InnoDB from MyISAM improve performance of comments table?
- Custom comment type based on thread level
- How to add internal, revision comments to page updates
- How to load and show comments with AJAX instead of pagination?
- Linking to Page Showing Only Comments Without Parent Post
- Comment Reply javascript
- How do we remove the H3 tag for the reply-title I.D
- Comments not appearing at all
- comments reply script not working
- How to display comment form error messages in the same page
- 3 moderators to approve comment
- How to deal with small scale comment spam on small commercial sites? [closed]
- A plugin where users can comment with Facebook or Twitter or OpenID [closed]
- WordPress registration message
- Check If comment author is registered
- Comments screen in backend, how to disable email address of commenter for non admins
- Add comments from the admin panel?
- How can I limit the number of comments per registered user per day?
- One comment per user per post but be able to reply to existing comments
- How build a custom login/register form with error handling?
- How to use a custom comments template
- Comment visibility
- What’s the easiest way to close comments on media/attachments?
- Reverse comment pagination numbers
- Get comments for more than one post
- How can I add comments to a page?
- How to remove comment spam in WordPress
- Post Comments using WP REST API v2 in WordPress
- show number of open comments on custom dashboard
- Show content only if member left a comment
- Add placeholder attribute to comment form fields
- How to remove the WordPress logo from login and register page?
- Why do I get accidental comments without (the required) email address?
- How is comment spam received without a comments form?
- Does a reply to a wordpress comment notify the author of the comment?
- What are the current recommended best-practices for comments.php?
- human_time_diff() returns “48 years ago” for all comments
- How do I set up real anonymous posting in bbpress forums? [closed]
- Comment Count for each Comment Author
- Link name in comments to Author page? Comment Author Meta in Comments?
- How do I turn off wordpress comments ability to capture a users ip address?
- Showing comments only to same custom user role
- Login email after registration never sent or received
- Parent comment’s author name
- Success message in comment form
- get_comments_number of depth-1 (Level 1) (1 post)
- Show comments from multiple post IDs in comment template
- Running a function on comment status change
- How to allow the reply link to remain on the comment form after I have reached my 10 nested comment limit?