added message payments in admin menu
This commit is contained in:
@@ -72,6 +72,7 @@ function output_list_front($array, $current_user, $user_id) {
|
||||
* - [custer_user_info user_email id='author'] -> display the email of the creator of the page/post
|
||||
* - [custer_user_info user_email id='logged_in' important] -> display the email of the connected user, even if surrounded by shortcode 'custer_change_id'
|
||||
* important keyword has no effect if id='author'
|
||||
* - [custer_user_info user_email if_empty="value"] -> display 'value' if the user_email is empty or does not exist
|
||||
*
|
||||
*/
|
||||
function current_user_infos($atts) {
|
||||
@@ -86,12 +87,14 @@ function current_user_infos($atts) {
|
||||
$id_is = 'logged_in';
|
||||
*/
|
||||
$id_is = 'author';
|
||||
$if_empty = '';
|
||||
|
||||
|
||||
/*
|
||||
* has parameter 'id' ?
|
||||
* has parameter important ?
|
||||
* if yes, removes them from $atts
|
||||
* has parameter if_empty ?
|
||||
* if yes, handle them and removes them from $atts
|
||||
*
|
||||
*/
|
||||
if (is_array($atts)) {
|
||||
@@ -106,6 +109,10 @@ function current_user_infos($atts) {
|
||||
unset($atts[$key]);
|
||||
}
|
||||
}
|
||||
if (isset($atts['if_empty'])) {
|
||||
$if_empty = $atts['if_empty'];
|
||||
unset($atts['if_empty']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +182,7 @@ function current_user_infos($atts) {
|
||||
$query = $atts;
|
||||
else
|
||||
return '';
|
||||
return \CUSTER\format_user_info($query, $current_user, $user_id);
|
||||
return \CUSTER\format_user_info($query, $current_user, $user_id, $if_empty);
|
||||
}
|
||||
add_shortcode('custer_user_info', __NAMESPACE__.'\current_user_infos');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user