Forum Replies Created

Viewing 1 replies (of 1 total)
  • This will add new shortcodes:

    [dynamictext dynamictext “CF7_get_current_user_email”]

    /* Insert information about the current user email
      */
    function cf7_get_current_user_email($atts){
    	extract(shortcode_atts(array(
    		'key' => 'user_email',
    	), $atts));
    
    	global $current_user;
    	get_currentuserinfo();
    
    	$val = $current_user->$key;
    	return $val;
    }
    add_shortcode('CF7_get_current_user_email', 'cf7_get_current_user_email');
    

    [dynamictext dynamictext “CF7_get_current_display_name”]

    /* Insert information about the current user name
      */
    function cf7_get_current_display_name($atts){
    	extract(shortcode_atts(array(
    		'key' => 'display_name',
    	), $atts));
    
    	global $current_user;
    	get_currentuserinfo();
    
    	$val = $current_user->$key;
    	return $val;
    }
    add_shortcode('CF7_get_current_display_name', 'cf7_get_current_display_name');
    
    • This reply was modified 9 years, 8 months ago by alkovalyov.
Viewing 1 replies (of 1 total)