Shortcode PHP file for two conditions passed when do shortcode

The do_shortcode() function takes two parameters, string $content, bool $ignore_html = false. If you can grab the content string before it is passed to the function, then you could do strpos() or some kind of regex to check, which parameters are present in the shortocode string. But otherwise I don’t think there’s a way to do the kind of conditional check you’re asking outside of do_shortcode().

A much more simpler, and more explicit, way to do the same thing is to include the conditional check inside your shortcode callback. Then you can have a default value (e.g. true/false) for rendering the icons and match it with the parameters passed to your shortcode.

For example your shortcode is used like this,

[your_shortcode icons=”true”]

Your callback would then look like this,

add_shortcode( 'your_shortcode', 'your_shortcode_callback' )
function your_shortcode_callback( $atts ) {

  $default = array(
    'icons' => false,
  );
  $atts = shortcode_atts( $default, $atts, 'your_shortcode' );

  if ( $atts['icons'] ) {

    // return markup with icons

  } else {

    // return markup without icons

  }

}