Created
July 22, 2014 01:13
-
-
Save iandunn/6732d8e829770654357e to your computer and use it in GitHub Desktop.
Example of reusing wcorg_login_message() in other contexts
This file contains hidden or 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
function camptix_require_login_please_login_message( $message ) { | |
/** @var $camptix CampTix_Plugin */ | |
global $camptix; | |
$please_login_message = sprintf( | |
__( 'Before purchasing your tickets, please <a href="%s">log in to your WordPress.org account</a>*.', 'wordcamporg' ), | |
wp_login_url( $camptix->get_tickets_url() ) | |
); | |
$message = str_replace( | |
__( 'Please use your <strong>WordPress.org</strong>* account to login.', 'wordcamporg' ), | |
$please_login_message, | |
wcorg_login_message( '', $camptix->get_tickets_url() ) | |
); | |
return $message; | |
} | |
add_filter( 'camptix_require_login_please_login_message', array( $this, 'camptix_require_login_please_login_message' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment