su_html_style

The shortcodes-ultimate su html style function.

Published Date - February 15, 2021

Description

Convert array with CSS rules into a style attribute (escaped).

su_html_style( $rules );

Parameters

  1. $rules


Usage

The following example is for adding a hook callback.

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

// The input(s). 
$rules = null;

// NOTICE! Understand what this does before running.
$result = su_html_style( $rules );
            

Defined

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

shortcodes-ultimate/includes/functions-html.php

function su_html_style( $rules ) {

	return ! empty( $rules )
		? ' style="' . esc_attr( implode( ';', $rules ) ) . '"'
		: '';

}