wordpress/wp-content/themes/basic/themify/themify-metabox/includes/themify-field-types.php
/**
 * Generates color picker
 *
 * @param array $args Field settings
 *
 * @since 1.3.2
 * @return string
 */
Generates color picker
@param array $args Field settings


Generates color picker @param array $args Field settings
function themify_meta_field_color( $args ) {
	$meta_box = $args['meta_box'];
	$meta_value = $args['meta_value'];
	extract($args, EXTR_OVERWRITE);
	$format = isset( $meta_box['format'] ) ? $meta_box['format'] : 'hex';
	$default = isset( $meta_box['meta']['default'] ) ? $meta_box['meta']['default'] : '';
	$html = sprintf( '
	<input type="text" id="%s" name="%s" value="%s" class="themify_input_field colorSelectInput" data-format="%s" />
	<input type="button" class="button clearColor" value="' . __('&times;', 'themify') . '">',
		esc_attr( $meta_box['name'] ), esc_attr( $meta_box['name'] ), esc_attr( $meta_value? $meta_value : $default ), esc_attr( $format ) );
	if(isset($meta_box['label']) && '' != $meta_box['label'])
		$html = sprintf('<label for="%s">%s %s</label>', esc_attr( $meta_box['name'] ), $html, esc_attr( $meta_box['label'] ));
	$html .= isset( $meta_box['description'] )? themify_meta_field_get_description($meta_box['description']) : '';
	if ( isset( $meta_box['before'] ) ) $html = $meta_box['before'] . $html;
	if ( isset( $meta_box['after'] ) ) $html .= $meta_box['after'];
	echo $html;
}
function themify_meta_field_color ( $ args ) { $ meta_box = $ args [ 'meta_box' ] ; $ meta_value = $ args [ 'meta_value' ] ; extract ( $ args , EXTR_OVERWRITE ) ; $ format = isset ( $ meta_box [ 'format' ] ) ? $ meta_box [ 'format' ] : 'hex' ; $ default = isset ( $ meta_box [ 'meta' ] [ 'default' ] ) ? $ meta_box [ 'meta' ] [ 'default' ] : '' ; $ html = sprintf ( '
	<input type="text" id="%s" name="%s" value="%s" class="themify_input_field colorSelectInput" data-format="%s" />
	<input type="button" class="button clearColor" value="' . __ ( '&times;' , 'themify' ) . '">' , esc_attr ( $ meta_box [ 'name' ] ) , esc_attr ( $ meta_box [ 'name' ] ) , esc_attr ( $ meta_value ? $ meta_value : $ default ) , esc_attr ( $ format ) ) ; if ( isset ( $ meta_box [ 'label' ] ) && '' != $ meta_box [ 'label' ] ) $ html = sprintf ( '<label for="%s">%s %s</label>' , esc_attr ( $ meta_box [ 'name' ] ) , $ html , esc_attr ( $ meta_box [ 'label' ] ) ) ; $ html .= isset ( $ meta_box [ 'description' ] ) ? themify_meta_field_get_description ( $ meta_box [ 'description' ] ) : '' ; if ( isset ( $ meta_box [ 'before' ] ) ) $ html = $ meta_box [ 'before' ] . $ html ; if ( isset ( $ meta_box [ 'after' ] ) ) $ html .= $ meta_box [ 'after' ] ; echo $ html ; }
Generates color picker
 @param array $args Field settings
Generates color picker @param array $args Field settings