Skip Navigation

[Resolved] Placeholder for site url

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to send Site url, name, and login_page url in email notification using CRED form?

Solution:
1. For site name you can use builtin shortcode of Views [wpv-bloginfo] and for Site url you can use a custom shortcode [bloginfo_siteurl]

Please add this code in your theme’s or child theme’s functions.php file:

function bloginfo_siteurl_func( ) {
    return get_site_url();
}
add_shortcode( 'bloginfo_siteurl', 'bloginfo_siteurl_func' );

For frontend login page, please add this code in your theme’s or child theme’s functions.php file:

function ls_login_url_func( ) {
    return wp_login_url();
}
add_shortcode( 'ls_login_url', 'ls_login_url_func' );

2. Then use shortcodes in the CRED notification body like this:

Site name: [wpv-bloginfo]
Site url: [bloginfo_siteurl]
Login page url: [ls_login_url]

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by spiridonR 4 years ago.

Assigned support staff: Noman.

Author
Posts
#567125

Hi. I need in the mail notification send when a new user is registered to add the following:
- site url
- site name
- the login_page url.

I don't want to put them hardcoded.

Is there a placeholder similar to %%RESET_PASSWORD_LINK%% or should I create custom of each one of them?

Thanks in advance

#567166

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for getting in touch with us. For site name you can use builtin shortcode of Views [wpv-bloginfo] and for Site url you can use a custom shortcode [bloginfo_siteurl]

Please add this code in your theme’s or child theme’s functions.php file:

function bloginfo_siteurl_func( ) {
	return get_site_url();
}
add_shortcode( 'bloginfo_siteurl', 'bloginfo_siteurl_func' );

Then use shortcodes in the CRED notification body like this:

Site name: [wpv-bloginfo]
Site url: [bloginfo_siteurl]
Login page url: [bloginfo_siteurl]/mylogin

For frontend login page, we can’t detect it directly that were the login form actually exists, you can add the page slug of the login page in front of shortcode like above.

I hope it helps, Thank you

#567179

Hi, thanks for the prompt answer.

I managed also to get the login url via shortcode using the following in my functions.php file:

function ls_login_url_func( ) {
    return wp_login_url();
}
add_shortcode( 'ls_login_url', 'ls_login_url_func' );

and then

Login page url: [ls_login_url]