Check if User has entered Data in User Profile Form Field
-
Here is something that has stumped me for some time and I am hoping someone can assist with a solution. I have added additional Contact fields, for Twitter & Facebook, using the
add_filter
method. From there, I have created an author.php template to serve up the current author’s description, Twitter link, Facebook link and Website URL.This works perfectly with one hitch. If the user does not have a website URL in the
$user_url
field, thehref
URL that is passed through on the site defaults back to the Author archive. I would like to run a check to see if the given field has any data. Here is what I have tried unsuccessfully:<?php if ( $curauth->$user_url ) != '' { ?> <!-- do something --> <?php } ?>
Any help is greatly appreciated.
- The topic ‘Check if User has entered Data in User Profile Form Field’ is closed to new replies.