Skip to main content
Added additional code sample and link.
Source Link
stealthyninja
  • 1.1k
  • 1
  • 15
  • 21

Try

<?php 
if ( !empty( array ( $curauth->facebook ) ) || 
     !empty ( array ( $curauth->linkedin ) ) || 
     !empty( array( $curauth->twitter ) ) )
{ 
    echo 'echo me if any $curauth info exists'; 
} 
?>

Note: This can be all on fewer lines, I've just put in additional line-breaks to make it all fit to avoid a horizontal scrollbar.


Update:
Reading up on Author Templates made me realise that once you've set the $curauth variable, e.g.

$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));

you should be able to use this instead:

<?php 
if ( !empty ( $curauth->facebook ) || 
     !empty ( $curauth->linkedin ) || 
     !empty ( $curauth->twitter ) )
{ 
    echo 'echo me if any $curauth info exists'; 
} 
?>

Try

<?php 
if ( !empty( array ( $curauth->facebook ) ) || 
     !empty ( array ( $curauth->linkedin ) ) || 
     !empty( array( $curauth->twitter ) ) )
{ 
    echo 'echo me if any $curauth info exists'; 
} 
?>

Note: This can be all on fewer lines, I've just put in additional line-breaks to make it all fit to avoid a horizontal scrollbar.

Try

<?php 
if ( !empty( array ( $curauth->facebook ) ) || 
     !empty ( array ( $curauth->linkedin ) ) || 
     !empty( array( $curauth->twitter ) ) )
{ 
    echo 'echo me if any $curauth info exists'; 
} 
?>

Note: This can be all on fewer lines, I've just put in additional line-breaks to make it all fit to avoid a horizontal scrollbar.


Update:
Reading up on Author Templates made me realise that once you've set the $curauth variable, e.g.

$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));

you should be able to use this instead:

<?php 
if ( !empty ( $curauth->facebook ) || 
     !empty ( $curauth->linkedin ) || 
     !empty ( $curauth->twitter ) )
{ 
    echo 'echo me if any $curauth info exists'; 
} 
?>
Source Link
stealthyninja
  • 1.1k
  • 1
  • 15
  • 21

Try

<?php 
if ( !empty( array ( $curauth->facebook ) ) || 
     !empty ( array ( $curauth->linkedin ) ) || 
     !empty( array( $curauth->twitter ) ) )
{ 
    echo 'echo me if any $curauth info exists'; 
} 
?>

Note: This can be all on fewer lines, I've just put in additional line-breaks to make it all fit to avoid a horizontal scrollbar.