ad contact form lacks login link with redirect
ClassiPress provides the option to require users to be logged in in order to contact ad posters. With that option enabled, ClassiPress behaves as follows: When a logged-out user views an ad, the contact form is replaced with a message saying, "You must be logged in to inquire about this ad."
About the message:
This message is defined on line 58
. It is inside the _e()
function, which allows developers to translate it using .mo files. All of that works fine.
_e( 'You must be logged in to inquire about this ad.', APP_TD );
What's the problem:
While the message tells the user he/she must login, it doesn't display a login link
with a redirect to the current page. I think this is an opportunity to improve the usability of the theme.
Although developers can translate the original string using an .mo file, they still can't insert a dynamic login link with a redirect to the current page without modifying PHP code (or JS, etc.).
I see other strings in the .mo file that include parameters. My request is for AppThemes to add the site login URL (with a redirect to the current page) as a parameter to this string
like they did for other strings; e.g. "You must be <a href='%s'>logged in</a> to post a comment." on line 120 of theme-comments.php, which combines the printf()
and the __()
functions as shown below
printf( __( "You must be <a href='%s'>logged in</a> to post a comment.", APP_TD ), wp_login_url( get_permalink() ) );