su_shortcode_dropcap

The shortcodes-ultimate su shortcode dropcap function.

Published Date - February 15, 2021

Description

su_shortcode_dropcap( $atts, $content );

Parameters

  1. $atts

  2. $content


Usage

The following example is for adding a hook callback.

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

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

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

Defined

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

shortcodes-ultimate/includes/shortcodes/dropcap.php

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

	$atts = shortcode_atts( array(
			'style' => 'default',
			'size'  => 3,
			'class' => ''
		), $atts, 'dropcap' );

	$atts['style'] = str_replace( array( '1', '2', '3' ), array( 'default', 'light', 'default' ), $atts['style'] ); // 3.x

	$em = intval( $atts['size'] ) * 0.5 . 'em';

	su_query_asset( 'css', 'su-shortcodes' );

	return '<span class="su-dropcap su-dropcap-style-' . $atts['style'] . su_get_css_class( $atts ) . '" style="font-size:' . $em . '">' . do_shortcode( $content ) . '</span>';

}