some more little codes for restrictions and registrations
This commit is contained in:
29
plugins/fipfcard_plugin/php/user_infos.php
Normal file
29
plugins/fipfcard_plugin/php/user_infos.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* it means someone outside wp is accessing the file, in this case kill it.
|
||||
*/
|
||||
if (!defined('ABSPATH')) {
|
||||
die('You can not access this file!');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* shortcode to write email of the logged in user
|
||||
*/
|
||||
function current_user_email_shortcode() {
|
||||
$text_not_logged_in = "you are not logged in";
|
||||
if (is_user_logged_in()) {
|
||||
$current_user = wp_get_current_user();
|
||||
return $current_user->user_email;
|
||||
}
|
||||
else {
|
||||
return $text_not_logged_in;
|
||||
}
|
||||
}
|
||||
add_shortcode('cipf_user_email', 'current_user_email_shortcode');
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user