some more little codes for restrictions and registrations

This commit is contained in:
asus
2024-03-02 21:43:43 +01:00
parent 7738ad1863
commit 8862bab1bd
16 changed files with 312 additions and 131 deletions

View 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');
?>