su_do_nested_shortcodes_alt

The shortcodes-ultimate su do nested shortcodes alt function.

Published Date - February 15, 2021

Description

Custom do_shortcode function for nested shortcodes

su_do_nested_shortcodes_alt( $content, $pre );

Parameters

  1. $content

  2. $pre


Usage

The following example is for adding a hook callback.

if ( !function_exists( 'su_do_nested_shortcodes_alt' ) ) {
    require_once ABSPATH . PLUGINDIR . 'shortcodes-ultimateshortcodes-ultimate/includes/functions-shortcodes.php';
}

// The input(s). 
$content = null;
$pre = null;

// NOTICE! Understand what this does before running.
$result = su_do_nested_shortcodes_alt( $content, $pre );
            

Defined

The function is defined in the following location(s).

shortcodes-ultimate/includes/functions-shortcodes.php

function su_do_nested_shortcodes_alt( $content, $pre ) {

	if ( strpos( $content, '[_' ) !== false ) {
		$content = preg_replace( '@(\[_*)_(' . $pre . '|/)@', '$1$2', $content );
	}

	return do_shortcode( $content );

}