Popup on PHP Code Check
-
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?
- The topic ‘Popup on PHP Code Check’ is closed to new replies.