Skip to content

codespacing/cmb2-field-cs-boxshadow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

cmb2-field-cs-boxshadow

Box shadow field type for CMB2

Example declaration

$your_cmb_matabox->add_field(array(
	'id' => $prefix . 'cs_boxshadow',			
	'name' => __( 'Box shadow', 'cmb2' ),
	'desc' => __( 'Field description', 'cmb2' ),
	'type' => 'cs_boxshadow',
	'options' => array(
		'preview' => true, // Show/Hide the "preview" area
		'toggle' => true, // Display all box shadow fields inside collapsible area
	),
));

Return values

Array
(
    [horizontal_length] => 4
    [vertical_length] => 5
    [blur_radius] => 5
    [spread_radius] => 3
    [color] => #000000
    [opacity] => 0.12
    [box-shadow] => 4px 5px 5px 3px rgba(0,0,0,0.12)
)

Example 1

$form_shadow = get_post_meta( get_the_ID(), 'your_field_id' );

echo "form{";
    echo "-webkit-box-shadow: " . $form_shadow['box-shadow'] . ";";
    echo "-moz-box-shadow: " . $form_shadow['box-shadow'] . ";";
    echo "box-shadow: " . $form_shadow['box-shadow'] . ";";
echo "}";

Screenshot

Changelog

1.0

  • Initial commit

About

Box shadow field type for CMB2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published