• Resolved Erik Ford

    (@wearepixel8)


    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, the href 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.

Viewing 1 replies (of 1 total)
  • Thread Starter Erik Ford

    (@wearepixel8)

    After posting this topic, and looking at my code, I quickly found my mistake. The conditional statement should read:

    <?php if ( ($curauth->user_url ) !='' ) { ?>
    <!-- do something -->
    <?php } ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Check if User has entered Data in User Profile Form Field’ is closed to new replies.