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
<?php | |
// In an mu-plugin... | |
function activate_default_camptix_module( $modules ) { | |
global $camptix; | |
$modules[] = $camptix->get_default_addon_path( 'require-login.php' ); | |
return $modules; | |
} |
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
<?php | |
/* | |
* Outputs the type, length and contents of a variable in a readable format, which can be useful for debugging. | |
* Output can be sent to echo(), die() / wp_die(), returned, a WordPress transient or a WordPress admin notice | |
* (via the IDAdminNotice class, not included). There are extra output methods for use in a WordPress environment, | |
* but it will also work on it's own. | |
*/ | |
/* |
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
/** | |
* Programmatically logs a user in | |
* | |
* @param string $username | |
* @return bool True if the login was successful; false if it wasn't | |
*/ | |
function programmatic_login( $username ) { | |
if ( is_user_logged_in() ) { | |
wp_logout(); |
NewerOlder