PHP Class Kirki_Output, kirki

Show file Open project: aristath/kirki Class Usage Examples

Protected Properties

Property Type Description
$config_id string The Kirki configuration used in the field.
$output array The field's output argument.
$styles array An array of the generated styles.
$value string | array The value.

Public Methods

Method Description
__construct ( string $config_id, array $output, string | array $value ) The class constructor.
get_styles ( ) : array Exploses the private $styles property to the world

Protected Methods

Method Description
apply_sanitize_callback ( array $output, string | array $value ) : string | array If we have a sanitize_callback defined, apply it to the value.
apply_value_pattern ( array $output, string | array $value ) : string | array If we have a value_pattern defined, apply it to the value.
parse_output ( ) Parses the output arguments.
process_output ( array $output, string $value ) : void Parses an output and creates the styles array for it.
process_property_value ( string $property, string $value ) : array Some CSS properties are unique.
process_value ( string | array $value, array $output ) : string | array Returns the value.

Method Details

__construct() public method

The class constructor.
public __construct ( string $config_id, array $output, string | array $value )
$config_id string The config ID.
$output array The output argument.
$value string | array The value.

apply_sanitize_callback() protected method

If we have a sanitize_callback defined, apply it to the value.
protected apply_sanitize_callback ( array $output, string | array $value ) : string | array
$output array The output args.
$value string | array The value.
return string | array

apply_value_pattern() protected method

If we have a value_pattern defined, apply it to the value.
protected apply_value_pattern ( array $output, string | array $value ) : string | array
$output array The output args.
$value string | array The value.
return string | array

get_styles() public method

Exploses the private $styles property to the world
public get_styles ( ) : array
return array

parse_output() protected method

Calls the process_output method for each of them.
protected parse_output ( )

process_output() protected method

Parses an output and creates the styles array for it.
protected process_output ( array $output, string $value ) : void
$output array The field output.
$value string The value.
return void

process_property_value() protected method

We need to tweak the value to make everything works as expected.
protected process_property_value ( string $property, string $value ) : array
$property string The CSS property.
$value string The value.
return array

process_value() protected method

Returns the value.
protected process_value ( string | array $value, array $output ) : string | array
$value string | array The value.
$output array The field "output".
return string | array

Property Details

$config_id protected property

The Kirki configuration used in the field.
protected string $config_id
return string

$output protected property

The field's output argument.
protected array $output
return array

$styles protected property

An array of the generated styles.
protected array $styles
return array

$value protected property

The value.
protected string|array $value
return string | array