su_shortcode_dummy_text

The shortcodes-ultimate su shortcode dummy text function.

Published Date - February 15, 2021

Description

su_shortcode_dummy_text( $atts, $content );

Parameters

  1. $atts

  2. $content


Usage

The following example is for adding a hook callback.

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

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

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

Defined

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

shortcodes-ultimate/includes/shortcodes/dummy-text.php

function su_shortcode_dummy_text( $atts = null, $content = null ) {

	$atts = shortcode_atts(
		array(
			'amount'  => 1,
			'what'    => 'paras',
			'cache'   => 'yes',
			'wrapper' => 'yes',
			'class'   => '',
		),
		$atts,
		'dummy_text'
	);

	$atts['what']   = sanitize_key( $atts['what'] );
	$atts['amount'] = intval( $atts['amount'] );

	$html = su_shortcode_dummy_text_fetch(
		$atts['what'],
		$atts['amount'],
		$atts['cache']
	);

	if ( 'yes' === $atts['wrapper'] || '' !== $atts['class'] ) {

		$html = sprintf(
			'<div class="su-dummy-text%s">%s</div>',
			su_get_css_class( $atts ),
			$html
		);

	}

	return $html;

}