• Resolved max34211

    (@max34211)


    Hi there,

    I have this shortcode that im creating where if an attribute is empty I don’t want anything to happen. Can somebody tell me what I should use to do so?

    if(!empty($ptitle)){
       //dont do anything
       }else{
       //do this code
       }
Viewing 1 replies (of 1 total)
  • if( !empty( $ptitle )) {
         // Do your stuff in here!
    }

    That’s what you’re looking for. That says that if the value isn’t empty then do something, and if it is empty there’s nothing to do.

Viewing 1 replies (of 1 total)

The topic ‘Shortcode – is_empty or null’ is closed to new replies.