su_shortcode_column

The shortcodes-ultimate su shortcode column function.

Published Date - February 15, 2021

Description

su_shortcode_column( $atts, $content );

Parameters

  1. $atts

  2. $content


Usage

The following example is for adding a hook callback.

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

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

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

Defined

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

shortcodes-ultimate/includes/shortcodes/column.php

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

	$atts = shortcode_atts( array(
			'size'   => '1/2',
			'center' => 'no',
			'last'   => null,
			'class'  => ''
		), $atts, 'column' );

	if ( $atts['last'] !== null && $atts['last'] == '1' ) {
		$atts['class'] .= ' su-column-last';
	}

	if ( $atts['center'] === 'yes' ) {
		$atts['class'] .= ' su-column-centered';
	}

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

	return '<div class="su-column su-column-size-' . str_replace( '/', '-', $atts['size'] ) . su_get_css_class( $atts ) . '"><div class="su-column-inner su-u-clearfix su-u-trim">' . su_do_nested_shortcodes( $content, 'column' ) . '</div></div>';

}