Check whether a custom filed has value or not

Hi,

Might be a beginner level question.

I have a custom field Card No which I can display using following Short code:
[s2Get user_field=“card_no” /]

How can I check whether there is a value on this field or not.

Can anyone share S2M Short code or its equivalent PHP code.

Regards,
Khurram

Try this:

function is_card_no() {
  $card_no = do_shortcode('[s2Get user_field="card_no" /]');
  return ($card_no != '')?$card_no:false;
}

Thanks for this function but I am not an expert in PHP.

Can you please tell me how can I use this function.

What If Else condition I will use.

Please read this manual.