Variable {USER}

jetFlow.io > Documentation  > Workflow Variables  > Variable {USER}

Variable {USER}

This variable contains information pertaining to the currently logged-in WordPress user.

For instance, to send an email to the current user use pattern {USER.user_email} to get an email address and {USER.display_name} as the name of the recipient.

Or, for instance, you can stop the execution of a workflow conditionally if the user does not have the capability to upload files. To achieve this, use variable {USER.allcaps.upload_files} in the action Stop if.

See also: How to check if a user has a particular role.

Example of the full structure of the USER variable:

    [ID] => 2
    [user_login] => john
    [user_pass] => 
    [user_nicename] =>  John
    [user_email] => jetflow@wpcerber.com
    [user_url] => https://jetflow.io
    [user_registered] => 2014-12-22 20:51:53
    [user_activation_key] => 
    [user_status] => 0
    [display_name] => John Coltrane
    [nickname] => John
    [first_name] => John
    [last_name] => Coltrane
    [description] => John William Coltrane was an American jazz saxophonist and composer.
    [data] => Array
        (
            [ID] => 2
            [user_login] => john
            [user_pass] => 
            [user_nicename] => John
            [user_email] => jetflow@wpcerber.com
            [user_url] => https://jetflow.io
            [user_registered] => 2014-12-22 20:51:53
            [user_activation_key] => 
            [user_status] => 0
            [display_name] => John Coltrane
        )

    [caps] => Array
        (
            [administrator] => 1
            [frm_view_forms] => 1
            [frm_edit_forms] => 1
            [frm_delete_forms] => 1
            [frm_change_settings] => 1
            [bbp_keymaster] => 1
        )

    [cap_key] => mb_capabilities
    [roles] => Array
        (
            [0] => administrator
            [5] => bbp_keymaster
        )

    [allcaps] => Array
        (
            [switch_themes] => 1
            [edit_themes] => 1
            [activate_plugins] => 1
            [edit_plugins] => 1
            [edit_users] => 1
            [edit_files] => 1
            [manage_options] => 1
            [moderate_comments] => 1
            [manage_categories] => 1
            [manage_links] => 1
            [upload_files] => 1
            [import] => 1
            [unfiltered_html] => 1
            [edit_posts] => 1
            [edit_others_posts] => 1
            [edit_published_posts] => 1
            [publish_posts] => 1
            [edit_pages] => 1
            [read] => 1
            [level_10] => 1
            [level_9] => 1
            [level_8] => 1
            [level_7] => 1
            [level_6] => 1
            [level_5] => 1
            [level_4] => 1
            [level_3] => 1
            [level_2] => 1
            [level_1] => 1
            [level_0] => 1
            [edit_others_pages] => 1
            [edit_published_pages] => 1
            [publish_pages] => 1
            [delete_pages] => 1
            [delete_others_pages] => 1
            [delete_published_pages] => 1
            [delete_posts] => 1
            [delete_others_posts] => 1
            [delete_published_posts] => 1
            [delete_private_posts] => 1
            [edit_private_posts] => 1
            [read_private_posts] => 1
            [delete_private_pages] => 1
            [edit_private_pages] => 1
            [read_private_pages] => 1
            [delete_users] => 1
            [create_users] => 1
            [unfiltered_upload] => 1
            [edit_dashboard] => 1
            [update_plugins] => 1
            [delete_plugins] => 1
            [install_plugins] => 1
            [update_themes] => 1
            [install_themes] => 1
            [update_core] => 1
            [list_users] => 1
            [remove_users] => 1
            [promote_users] => 1
            [edit_theme_options] => 1
            [delete_themes] => 1
            [export] => 1
            [frm_view_forms] => 1
            [frm_edit_forms] => 1
            [frm_delete_forms] => 1
            [frm_change_settings] => 1
            [copy_posts] => 1
            [administrator] => 1
            [bbp_keymaster] => 1
        )

This variable is using the get_userdata() function.

No Comments

Sorry, the comment form is closed at this time.