Skip to content

Instantly share code, notes, and snippets.

@gwin
Last active August 29, 2015 14:17
Show Gist options
  • Save gwin/ae443c9038d20b16ab8e to your computer and use it in GitHub Desktop.
Save gwin/ae443c9038d20b16ab8e to your computer and use it in GitHub Desktop.
Customize [wpjb_login] shortcode.
<?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