wordpress/wp-content/themes/basic/themify/themify-admin.php
/**
 * Default Custom Post sidebar Module
 * @param array $data Theme settings data
 * @return string Markup for module.
 * @since 4.0.0
 */
Default Custom Post sidebar Module
@param array $data Theme settings data
@return string Markup for module.
Default Custom Post sidebar Module @param array $data Theme settings data @return string Markup for module .
function themify_custom_post_type_layouts($data = array()){
	$data = themify_get_data();
	$prefix = 'setting-custom_post_';
	$output = '';
	$custom_posts = null;
	$post_types = get_post_types(array('public' => true, 'publicly_queryable' => 'true'), 'objects');
	$excluded_types = apply_filters( 'themify_exclude_CPT_for_sidebar', array('post', 'page', 'attachment', 'tbuilder_layout', 'tbuilder_layout_part', 'section','tglobal_style'));
	foreach ($post_types as $key => $value) {
		if (!in_array($key, $excluded_types)) {
			$custom_posts[$key] =  array( 'name' => $value->labels->singular_name, 'archive' => $value->has_archive );
		}
	}
	$custom_posts = apply_filters('themify_get_public_post_types', $custom_posts);
	$sidebar_location_options = apply_filters('themify_post_type_theme_sidebars' , array(
									array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'title' => __('Sidebar Right', 'themify')),
									array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')),
									array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar ', 'themify'))
								), false );
	if(is_array($custom_posts)){
		foreach($custom_posts as $key => $cPost){
			$output .= '<p>
							'. sprintf('<h4>%s %s</h4>', strtoupper($cPost['name']), __('POST TYPE', 'themify'));
			if ($cPost['archive']) {
				$output .= '<p>'. sprintf('<span class="label">%s %s</span>', ucfirst($cPost['name']), __('Archive Sidebar', 'themify'));
				$val = isset( $data[$prefix.$key.'_archive'] ) ? $data[$prefix.$key.'_archive'] : '';
				foreach ( $sidebar_location_options as $option ) {
					if ( ( '' == $val || ! $val || ! isset( $val ) ) && ( isset( $option['selected'] ) && $option['selected'] ) ) {
						$val = $option['value'];
					}
					if ( $val == $option['value'] ) {
						$class = "selected";
					} else {
						$class = "";
					}
					$output .= '<a href="#" class="preview-icon '.$class.'" title="'.$option['title'].'"><img src="'.THEME_URI.'/'.$option['img'].'" alt="'.$option['value'].'"  /></a>';
				}
				$output .= '<input type="hidden" name="'.$prefix.$key.'_archive" class="val" value="'.$val.'" /></p>';
			}
			$output .= '<p>'. sprintf('<span class="label">%s %s</span>', ucfirst($cPost['name']), __('Single Sidebar', 'themify'));
			$val = isset( $data[$prefix.$key.'_single'] ) ? $data[$prefix.$key.'_single'] : '';
			foreach ( $sidebar_location_options as $option ) {
				if ( ( '' == $val || ! $val || ! isset( $val ) ) && ( isset( $option['selected'] ) && $option['selected'] ) ) {
					$val = $option['value'];
				}
				if ( $val == $option['value'] ) {
					$class = "selected";
				} else {
					$class = "";
				}
				$output .= '<a href="#" class="preview-icon '.$class.'" title="'.$option['title'].'"><img src="'.THEME_URI.'/'.$option['img'].'" alt="'.$option['value'].'"  /></a>';
			}
			$output .= '<input type="hidden" name="'.$prefix.$key.'_single" class="val" value="'.$val.'" /></p>
						</p>';
		}
	}
	return $output;
}
function themify_custom_post_type_layouts ( $ data = array ( ) ) { $ data = themify_get_data ( ) ; $ prefix = 'setting-custom_post_' ; $ output = '' ; $ custom_posts = null ; $ post_types = get_post_types ( array ( 'public' => true , 'publicly_queryable' => 'true' ) , 'objects' ) ; $ excluded_types = apply_filters ( 'themify_exclude_CPT_for_sidebar' , array ( 'post' , 'page' , 'attachment' , 'tbuilder_layout' , 'tbuilder_layout_part' , 'section' , 'tglobal_style' ) ) ; foreach ( $ post_types as $ key => $ value ) { if ( ! in_array ( $ key , $ excluded_types ) ) { $ custom_posts [ $ key ] = array ( 'name' => $ value -> labels -> singular_name , 'archive' => $ value -> has_archive ) ; } } $ custom_posts = apply_filters ( 'themify_get_public_post_types' , $ custom_posts ) ; $ sidebar_location_options = apply_filters ( 'themify_post_type_theme_sidebars' , array ( array ( 'value' => 'sidebar1' , 'img' => 'images/layout-icons/sidebar1.png' , 'title' => __ ( 'Sidebar Right' , 'themify' ) ) , array ( 'value' => 'sidebar1 sidebar-left' , 'img' => 'images/layout-icons/sidebar1-left.png' , 'title' => __ ( 'Sidebar Left' , 'themify' ) ) , array ( 'value' => 'sidebar-none' , 'img' => 'images/layout-icons/sidebar-none.png' , 'title' => __ ( 'No Sidebar ' , 'themify' ) ) ) , false ) ; if ( is_array ( $ custom_posts ) ) { foreach ( $ custom_posts as $ key => $ cPost ) { $ output .= '<p>
							' . sprintf ( '<h4>%s %s</h4>' , strtoupper ( $ cPost [ 'name' ] ) , __ ( 'POST TYPE' , 'themify' ) ) ; if ( $ cPost [ 'archive' ] ) { $ output .= '<p>' . sprintf ( '<span class="label">%s %s</span>' , ucfirst ( $ cPost [ 'name' ] ) , __ ( 'Archive Sidebar' , 'themify' ) ) ; $ val = isset ( $ data [ $ prefix . $ key . '_archive' ] ) ? $ data [ $ prefix . $ key . '_archive' ] : '' ; foreach ( $ sidebar_location_options as $ option ) { if ( ( '' == $ val || ! $ val || ! isset ( $ val ) ) && ( isset ( $ option [ 'selected' ] ) && $ option [ 'selected' ] ) ) { $ val = $ option [ 'value' ] ; } if ( $ val == $ option [ 'value' ] ) { $ class = " selected " ; } else { $ class = " " ; } $ output .= '<a href="#" class="preview-icon ' . $ class . '" title="' . $ option [ 'title' ] . '"><img src="' . THEME_URI . '/' . $ option [ 'img' ] . '" alt="' . $ option [ 'value' ] . '"  /></a>' ; } $ output .= '<input type="hidden" name="' . $ prefix . $ key . '_archive" class="val" value="' . $ val . '" /></p>' ; } $ output .= '<p>' . sprintf ( '<span class="label">%s %s</span>' , ucfirst ( $ cPost [ 'name' ] ) , __ ( 'Single Sidebar' , 'themify' ) ) ; $ val = isset ( $ data [ $ prefix . $ key . '_single' ] ) ? $ data [ $ prefix . $ key . '_single' ] : '' ; foreach ( $ sidebar_location_options as $ option ) { if ( ( '' == $ val || ! $ val || ! isset ( $ val ) ) && ( isset ( $ option [ 'selected' ] ) && $ option [ 'selected' ] ) ) { $ val = $ option [ 'value' ] ; } if ( $ val == $ option [ 'value' ] ) { $ class = " selected " ; } else { $ class = " " ; } $ output .= '<a href="#" class="preview-icon ' . $ class . '" title="' . $ option [ 'title' ] . '"><img src="' . THEME_URI . '/' . $ option [ 'img' ] . '" alt="' . $ option [ 'value' ] . '"  /></a>' ; } $ output .= '<input type="hidden" name="' . $ prefix . $ key . '_single" class="val" value="' . $ val . '" /></p>
						</p>' ; } } return $ output ; }
Default Custom Post sidebar Module
 @param array $data Theme settings data
 @return string Markup for module.
Default Custom Post sidebar Module @param array $data Theme settings data @return string Markup for module .
/**
	 * Theme Settings Option Key Prefix
	 * @var string
	 */ /**
	 * Module markup
	 * @var string
	*/ /**
	 * Sidebar placement options
	 * @var array
	 */ /**
	 * Page sidebar placement
	 */