Conditional check if a featured media has been set


#1

Is there a conditional check available which can tell if a featured media has been set? e.g.

if rtmedia_featured_has_been_set {  
//a featured media has been set  
} else {  
//a featured media is not currently set  
}

#2

Hi,

You could try using rtmedia_get_featured($user_id) in the if condition.

$user_id is an optional parameter.


#3

if ( rtmedia_get_featured( $user_id ) ) {

}

worked perfectly! thanks for the tip :slight_smile:


#4