• Resolved tedstur

    (@tedstur)


    I am trying to force users to setup their personal profile on my site.

    I am using custom user meta data to set a person’s role (for example, “CEO” or “Cook”). If that user meta is not set, then I want a popup to force them to set it.

    I am using PHP Insert to do check this:

    [insert_php]
    $current_user = wp_get_current_user();
    if ( !($current_user instanceof WP_User) )
    {
    echo ‘Not found</br>’;
    } else {
    $key = ‘my_role’;
    $single = true;
    $my_role = get_user_meta( $current_user->ID, $key, $single );
    if (strlen($my_role) > 0 )
    {
    echo ‘<p>Your Role: ‘. $my_role . ‘</p>’;
    } else {
    echo ‘ ‘; // <— HERE IS WHERE I WOULD CREATE THE POPUP???
    }
    }
    [/insert_php]

    Any thoughts on what what the echo statement could look like to create the popup?

Viewing 1 replies (of 1 total)
  • Plugin Author Damian

    (@timersys)

    You could create a popup and set the trigger to manual triggering. Let’s say your popup for example has ID 123

    so you could do:
    echo ‘<script type=”text/javascript”>SPU.open(‘123′)</script>’;

    So basically the popup already exist, all you do is open if needed

    If you like the plugin / support please leave a short review. It’s a tremendous help for us!

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Popup on PHP Code Check’ is closed to new replies.