su_do_shortcode

The shortcodes-ultimate su do shortcode function.

Published Date - February 15, 2021

Description

Custom do_shortcode function for nested shortcodes

su_do_shortcode( $content, $pre );

Parameters

  1. $content

  2. $pre


Usage

The following example is for adding a hook callback.

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

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

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

Defined

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

shortcodes-ultimate/includes/deprecated/functions.php

function su_do_shortcode( $content, $pre ) {

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

	return do_shortcode( $content );

}