wordpress/wp-content/themes/basic/themify/themify-admin.php
/**
 * Outputs post meta options
 * @param string $pmkey Key used to get data from theme settings array
 * @param array $data Theme settings data
 * @param array $metas Optional array stating the metas available.
 * @return string $out Markup for options
 */
Outputs post meta options
@param string $pmkey Key used to get data from theme settings array
@param array $data Theme settings data
@param array $metas Optional array stating the metas available.
@return string $out Markup for options
Outputs post meta options @param string $pmkey Key used to get data from theme settings array @param array $data Theme settings data @param array $metas Optional array stating the metas available . @return string $out Markup for options
function themify_post_meta_options( $pmkey, $data, $metas = array(), $states = array(), $group_label = false ) {
	if ( empty($metas ) ) {
		$metas = array (
			''			=> __( 'Hide All', 'themify' ),
	 		'author' 	=> __( 'Author', 'themify' ),
	 		'category' 	=> __( 'Category', 'themify' ),
	 		'comment' 	=> __( 'Comment', 'themify' ),
	 		'tag' 		=> __( 'Tag', 'themify' )
		);
	}
	if ( empty( $states ) ) {
		$states = array(
			array(
				'name' => __( 'Hide', 'themify' ),
				'value' => 'yes',
				'icon' => THEMIFY_URI . '/img/ddbtn-check.svg',
				'title' => __( 'Hide this meta', 'themify' )
			),
			array(
				'name' => __( 'Do not hide', 'themify' ),
				'value' => 'no',
				'icon' => THEMIFY_URI . '/img/ddbtn-cross.svg',
				'title' => __( 'Show this meta', 'themify' )
			)
		);
	}
	if ( ! $group_label ) {
		$group_label = __( 'Hide Post Meta', 'themify' );
	}
	$default = array(
		'name' => __( 'Theme', 'themify' ),
		'value' => '',
		'icon' => THEMIFY_URI . '/img/ddbtn-blank.png',
		'title' => esc_attr(__( 'Use theme settings', 'themify' ))
	);
	$out = '<div class="themify_field_row dropdownbutton-group"><span class="label">' . esc_html( $group_label ) . '</span>';
			foreach ( $metas as $meta => $name ) {
				if ( '' == $meta ) {
					$metakey = $pmkey;
					$meta_class = 'ddbtn-all';
				} else {
					$metakey = $pmkey.'_'.$meta;
					$meta_class = 'ddbtn-sub ddbtn-'.$meta;
				}
				$name=esc_html( $name );
				$others = '';
				$out .=	'<div id="' . $metakey. '" class="dropdownbutton-list" data-name="' . $name . '" data-def-icon="' . $default['icon']. '">';
				$first = '
					<div class="first-ddbtn">
						<a href="#" data-val="' . $default['value'] . '" data-name="' . $default['name']  . '" title="' . $default['title'] . '">
							<img src="' . $default['icon'] . '" title="' . $default['title'] . '" />
							<span class="ddbtn-name">' . $name . '</span>
						</a>
					</div>';
				foreach ( $states as $state ) {
					$title=esc_attr($state['title']);
					if ( isset( $state['value'] ) && isset( $data[$metakey] ) && $state['value'] === $data[$metakey] ) {
					    $first = '<div class="first-ddbtn">
						    <a href="#" data-val="' . $state['value'] . '" data-name="' . $state['name'] . '" title="' . $title. '">
							    <img src="' . $state['icon']. '" title="' . $title . '" />
							    <span class="ddbtn-name">' . $name . '</span>
						    </a>
					    </div>';
					    $selected = 'selected';
					} else {
						$selected = '';
					}
					$others .= '
						<div class="ddbtn">
							<a href="#" data-sel="' . $selected. '" data-val="' . $state['value'] . '" data-name="' . $state['name'] . '" title="' . $title . '">
								<img src="' . $state['icon'] . '" title="' . $title. '" />
								<span class="ddbtn-label">' . esc_html( $state['name'] ) . '</span>
							</a>
						</div>';
				}
				$out .= $first . '<div class="dropdownbutton">' . $others . '</div>';
				$out .= '
				</div>';
				$out .= '<input type="hidden" value="' . esc_attr( themify_get( $metakey ) ) . '" class="' . $meta_class. '" id="' . $metakey . '" name="' . $metakey . '" />';
			}
	$out .= '</div>';
	return $out;
}
function themify_post_meta_options ( $ pmkey , $ data , $ metas = array ( ) , $ states = array ( ) , $ group_label = false ) { if ( empty ( $ metas ) ) { $ metas = array ( '' => __ ( 'Hide All' , 'themify' ) , 'author' => __ ( 'Author' , 'themify' ) , 'category' => __ ( 'Category' , 'themify' ) , 'comment' => __ ( 'Comment' , 'themify' ) , 'tag' => __ ( 'Tag' , 'themify' ) ) ; } if ( empty ( $ states ) ) { $ states = array ( array ( 'name' => __ ( 'Hide' , 'themify' ) , 'value' => 'yes' , 'icon' => THEMIFY_URI . '/img/ddbtn-check.svg' , 'title' => __ ( 'Hide this meta' , 'themify' ) ) , array ( 'name' => __ ( 'Do not hide' , 'themify' ) , 'value' => 'no' , 'icon' => THEMIFY_URI . '/img/ddbtn-cross.svg' , 'title' => __ ( 'Show this meta' , 'themify' ) ) ) ; } if ( ! $ group_label ) { $ group_label = __ ( 'Hide Post Meta' , 'themify' ) ; } $ default = array ( 'name' => __ ( 'Theme' , 'themify' ) , 'value' => '' , 'icon' => THEMIFY_URI . '/img/ddbtn-blank.png' , 'title' => esc_attr ( __ ( 'Use theme settings' , 'themify' ) ) ) ; $ out = '<div class="themify_field_row dropdownbutton-group"><span class="label">' . esc_html ( $ group_label ) . '</span>' ; foreach ( $ metas as $ meta => $ name ) { if ( '' == $ meta ) { $ metakey = $ pmkey ; $ meta_class = 'ddbtn-all' ; } else { $ metakey = $ pmkey . '_' . $ meta ; $ meta_class = 'ddbtn-sub ddbtn-' . $ meta ; } $ name = esc_html ( $ name ) ; $ others = '' ; $ out .= '<div id="' . $ metakey . '" class="dropdownbutton-list" data-name="' . $ name . '" data-def-icon="' . $ default [ 'icon' ] . '">' ; $ first = '
					<div class="first-ddbtn">
						<a href="#" data-val="' . $ default [ 'value' ] . '" data-name="' . $ default [ 'name' ] . '" title="' . $ default [ 'title' ] . '">
							<img src="' . $ default [ 'icon' ] . '" title="' . $ default [ 'title' ] . '" />
							<span class="ddbtn-name">' . $ name . '</span>
						</a>
					</div>' ; foreach ( $ states as $ state ) { $ title = esc_attr ( $ state [ 'title' ] ) ; if ( isset ( $ state [ 'value' ] ) && isset ( $ data [ $ metakey ] ) && $ state [ 'value' ] === $ data [ $ metakey ] ) { $ first = '<div class="first-ddbtn">
						    <a href="#" data-val="' . $ state [ 'value' ] . '" data-name="' . $ state [ 'name' ] . '" title="' . $ title . '">
							    <img src="' . $ state [ 'icon' ] . '" title="' . $ title . '" />
							    <span class="ddbtn-name">' . $ name . '</span>
						    </a>
					    </div>' ; $ selected = 'selected' ; } else { $ selected = '' ; } $ others .= '
						<div class="ddbtn">
							<a href="#" data-sel="' . $ selected . '" data-val="' . $ state [ 'value' ] . '" data-name="' . $ state [ 'name' ] . '" title="' . $ title . '">
								<img src="' . $ state [ 'icon' ] . '" title="' . $ title . '" />
								<span class="ddbtn-label">' . esc_html ( $ state [ 'name' ] ) . '</span>
							</a>
						</div>' ; } $ out .= $ first . '<div class="dropdownbutton">' . $ others . '</div>' ; $ out .= '
				</div>' ; $ out .= '<input type="hidden" value="' . esc_attr ( themify_get ( $ metakey ) ) . '" class="' . $ meta_class . '" id="' . $ metakey . '" name="' . $ metakey . '" />' ; } $ out .= '</div>' ; return $ out ; }
Outputs post meta options
 @param string $pmkey Key used to get data from theme settings array
 @param array $data Theme settings data
 @param array $metas Optional array stating the metas available.
Outputs post meta options @param string $pmkey Key used to get data from theme settings array @param array $data Theme settings data @param array $metas Optional array stating the metas available .
// default state