Last active
August 29, 2015 14:17
-
-
Save gwin/ae443c9038d20b16ab8e to your computer and use it in GitHub Desktop.
Customize [wpjb_login] shortcode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// You can place this code in your theme functions.php file | |
// or create new plugin and put the code there. | |
add_filter("wpjb_shortcode_login", "my_wpjb_shortcode_login"); | |
function my_wpjb_shortcode_login(Daq_View $view) { | |
// Text on login button | |
$view->submit = "Login Me!" ; | |
// Set page to which user will be redirected on success | |
$view->form->getElement("redirect_to")->setValue("http://my-success-page.com"); | |
// Note you cannot modify $view->buttons array directly, | |
// you can only assign value to it. | |
$buttons = $view->buttons; | |
// Add another button (technically this can be any HTML tag) | |
$buttons[] = array( | |
"tag" => "a", | |
"href" => "http://example.com", | |
"html" => "Visit My Page" | |
); | |
$view->buttons = $buttons; | |
// hint if you do not want to display any links | |
// just add $view->buttons = array(); | |
// return $view object | |
return $view; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment