Forum Replies Created
- AuthorPosts
- January 18, 2015 at 9:24 pm in reply to: Popup the form then go to hyperlink once form is filled #13664
fohlhorst
ParticipantPerhaps a more simple description would be – how can I choose a target url from the form submit button?
So each time I add a form to a post, I can have a different destination URL once the form is submittedJanuary 18, 2015 at 9:22 pm in reply to: Modifying user validation code from suggestions for forms #13663fohlhorst
ParticipantYes – consider this thread closed
fohlhorst
ParticipantThis is perfect – thank you so much!
fohlhorst
ParticipantAlly – this works great!
$content = ‘This content is for members only, please log in or register first.’;
one question though, can the hyperlink be setup to return to the calling page using something like a &redirect_to= command, once the user logs in?
fohlhorst
ParticipantThanks – I did what was in the guide and that does effectively prevent the form from showing if the user is not logged in – what I would really like to do is offer a way to login / register as part of the logic – but, I am no coder!
so is there some way to put a hyperlink into the text that is shown from the function: code below like making the $content look like this? $content = ‘This content is for members only, please log in or register first. by clicking http:\\www.website.com\login.php’;
Simply put, I want the text that is stored in the content variable to be a hyperlink to a login page
or, better yet if I can make the logic place a widget on the post for social login
Below is the original code that has been added to the functions.php for the theme – so, I would want to modify that to either have a plugin show (Social Login widget) or at the very least, offer a hyperlink to the wp-login.php
function my_members_only_shortcode($atts, $content = null)
{
if (is_user_logged_in()) {
$content = do_shortcode($content);
} else {
$content = ‘This content is for members only, please log in or register first.’;
}return $content;
}
add_shortcode(‘members_only’, ‘my_members_only_shortcode’); - AuthorPosts