wordpress/wp-content/themes/basic/themify/themify-metabox/includes/themify-field-types.php
/**
 * query_category field type, display an option to select categories for Query Posts feature
 *
 * @since 2.8.8
 */
query_category field type, display an option to select categories for Query Posts feature
@since 2.8.8
query_category field type display an option to select categories for Query Posts feature @since 2 . 8 . 8
function themify_meta_field_query_category( $args ) {
	extract( $args );
	$terms_tax = isset($meta_box['meta']['taxonomy'])? $meta_box['meta']['taxonomy']: 'category';
	$terms_options = '';
	$terms_by_tax = get_terms($terms_tax);
	if( ! empty( $terms_by_tax ) && ! is_wp_error( $terms_by_tax ) ) {
		$terms_list = array();
		$terms_list['0'] = array(
			'title' => __( 'All Categories', 'themify' ),
			'slug'	=> '0'
		);
		foreach ($terms_by_tax as $term) {
			$terms_list[$term->term_id] = array(
				'title' => $term->name,
				'slug'	=> $term->slug
			);
		}
		foreach ($terms_list as $term_id => $term) {
			$term_selected = '';
			if(!is_numeric($meta_value)) {
				if($meta_value == $term['slug']) $term_selected = 'selected="selected"';
			} else {
				if($meta_value == $term_id) $term_selected = 'selected="selected"';
			}
			$terms_options .= sprintf(
				'<option value="%s" data-termid="%s" %s>%s</option>',
				$term['slug'],
				$term_id,
				$term_selected,
				$term['title']
			);
		}
		?>
		<select id="<?php echo esc_attr( $meta_box['name'] ); ?>" class="query_category_single">
			<option></option>
			<?php echo !empty( $terms_options ) ? $terms_options : ''; ?>
		</select>
		<?php _e('or', 'themify'); ?>
	<?php } ?> 
	<input type="text" class="query_category" value="<?php echo esc_attr( $meta_value ); ?>" />
	<input type="hidden" value="<?php echo esc_attr( $meta_value ); ?>" name="<?php echo esc_attr( $meta_box['name'] ); ?>" class="val" />
	<?php if ( isset( $meta_box['description'] ) ) : ?>
		<span class="themify_field_description"><?php echo wp_kses_post( $meta_box['description'] ); ?></span>
	<?php endif; 
}
function themify_meta_field_query_category ( $ args ) { extract ( $ args ) ; $ terms_tax = isset ( $ meta_box [ 'meta' ] [ 'taxonomy' ] ) ? $ meta_box [ 'meta' ] [ 'taxonomy' ] : 'category' ; $ terms_options = '' ; $ terms_by_tax = get_terms ( $ terms_tax ) ; if ( ! empty ( $ terms_by_tax ) && ! is_wp_error ( $ terms_by_tax ) ) { $ terms_list = array ( ) ; $ terms_list [ '0' ] = array ( 'title' => __ ( 'All Categories' , 'themify' ) , 'slug' => '0' ) ; foreach ( $ terms_by_tax as $ term ) { $ terms_list [ $ term -> term_id ] = array ( 'title' => $ term -> name , 'slug' => $ term -> slug ) ; } foreach ( $ terms_list as $ term_id => $ term ) { $ term_selected = '' ; if ( ! is_numeric ( $ meta_value ) ) { if ( $ meta_value == $ term [ 'slug' ] ) $ term_selected = 'selected="selected"' ; } else { if ( $ meta_value == $ term_id ) $ term_selected = 'selected="selected"' ; } $ terms_options .= sprintf ( '<option value="%s" data-termid="%s" %s>%s</option>' , $ term [ 'slug' ] , $ term_id , $ term_selected , $ term [ 'title' ] ) ; } ?> <select id=" <?php echo esc_attr ( $ meta_box [ 'name' ] ) ; ?> " class="query_category_single">
			<option></option>
			 <?php echo ! empty ( $ terms_options ) ? $ terms_options : '' ; ?> </select>
		 <?php _e ( 'or' , 'themify' ) ; ?> <?php } ?> <input type="text" class="query_category" value=" <?php echo esc_attr ( $ meta_value ) ; ?> " />

	<input type="hidden" value=" <?php echo esc_attr ( $ meta_value ) ; ?> " name=" <?php echo esc_attr ( $ meta_box [ 'name' ] ) ; ?> " class="val" />
	 <?php if ( isset ( $ meta_box [ 'description' ] ) ) : ?> <span class="themify_field_description"> <?php echo wp_kses_post ( $ meta_box [ 'description' ] ) ; ?> </span>
	 <?php endif ; }
query_category field type, display an option to select categories for Query Posts feature
 @since 2.8.8
query_category field type display an option to select categories for Query Posts feature @since 2 . 8 . 8
// meta_box description