false, 'conditional_check' => false, 'foreach' => false, ) ); if ( ( $args['conditional'] || $args['foreach'] ) && ! $args['conditional_check'] ) { $args['conditional_check'] = true; } $prefix = ''; if ( $args['conditional_check'] ) { if ( $args['conditional'] ) { $prefix = 'if '; } elseif ( $args['foreach'] ) { $prefix = 'foreach '; } } $with_tags = $args['conditional_check'] ? 3 : 2; if ( ! empty( $shortcodes[ $with_tags ][ $short_key ] ) ) { $tag = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] ); $tag = str_replace( ']', '', $tag ); $tag = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag ); $tags = preg_split( '/\s+/', $tag, 2 ); if ( is_array( $tags ) ) { $tag = $tags[0]; } } else { $tag = $shortcodes[ $with_tags - 1 ][ $short_key ]; } return $tag; } public static function remove_inline_conditions( $no_vars, $code, $replace_with, &$html ) { if ( $no_vars ) { $html = str_replace( '[if ' . $code . ']', '', $html ); $html = str_replace( '[/if ' . $code . ']', '', $html ); } else { $html = preg_replace( '/(\[if\s+' . $code . '\])(.*?)(\[\/if\s+' . $code . '\])/mis', '', $html ); } $html = str_replace( '[' . $code . ']', $replace_with, $html ); } }