echo rtrim($out, ' ,'); ?> </td> </tr> <?php } } ?> <?php $tf_post_types = apply_filters('tfuse_sidebar_posts', tf_get_post_types()); foreach ($tf_post_types as $key => $name) { $taxonomy = tf_custom_post_category($key); ?> <tr> <td> <?php $rel = $key . '+default_' . $key; ?> <a href="#" rel="<?php echo $rel; ?> " class="auto_select"><?php echo ucfirst($name); ?> </a>
public function placeholders_workout() { global $is_tf_blog_page, $is_tf_front_page; if (is_front_page()) { $is_tf_front_page = true; } $settings = $this->model->tf_get_settings(); if ($is_tf_blog_page) { $is_tf_front_page = false; if (isset($settings['default_is_blogpage'])) { $this->current_sidebars = $settings['default_is_blogpage']['sidebars']; $this->current_position = $settings['default_is_blogpage']['position']; return; } } if ($is_tf_front_page) { if (isset($settings['default_is_front_page'])) { $this->current_sidebars = $settings['default_is_front_page']['sidebars']; $this->current_position = $settings['default_is_front_page']['position']; return; } } if (is_singular()) { $the_id = get_the_ID(); $the_type = get_post_type(); if (isset($settings['by_id_' . $the_type][$the_id])) { $this->current_sidebars = $settings['by_id_' . $the_type][$the_id]['sidebars']; $this->current_position = $settings['by_id_' . $the_type][$the_id]['position']; return; } else { if (isset($settings['by_id_' . $the_type])) { foreach ($settings['by_id_' . $the_type] as $key => $val) { $split_ids = explode(',', $key); if (in_array($the_id, $split_ids)) { $this->current_sidebars = $settings['by_id_' . $the_type][$key]['sidebars']; $this->current_position = $settings['by_id_' . $the_type][$key]['position']; return; } } } } if (is_single()) { $terms = wp_get_post_terms($the_id, tf_custom_post_category($the_type)); foreach ($terms as $term) { if (isset($term->term_id)) { $is_in_multi = isset($settings['by_category_' . $the_type]) ? $this->is_in_multi_terms($settings['by_category_' . $the_type], $term->term_id) : false; if (isset($settings['by_category_' . $the_type][$term->term_id])) { $this->current_sidebars = $settings['by_category_' . $the_type][$term->term_id]['sidebars']; $this->current_position = $settings['by_category_' . $the_type][$term->term_id]['position']; return; } elseif ($is_in_multi) { $this->current_sidebars = $settings['by_category_' . $the_type][$is_in_multi]['sidebars']; $this->current_position = $settings['by_category_' . $the_type][$is_in_multi]['position']; return; } else { if (isset($settings['by_category_' . $the_type])) { foreach ($settings['by_category_' . $the_type] as $key => $val) { $split_ids = explode(',', $key); if (in_array($the_id, $split_ids)) { $this->current_sidebars = $settings['by_category_' . $the_type][$key]['sidebars']; $this->current_position = $settings['by_category_' . $the_type][$key]['position']; return; } } } } } } } // if (is_page()) { // $template_in_use = tf_page_template($the_id); // if (isset($settings['by_template_page'][$template_in_use])) { // $this->current_sidebars = $settings['by_template_page'][$template_in_use]['sidebars']; // $this->current_position = $settings['by_template_page'][$template_in_use]['position']; // return; // } // } if (isset($settings['default_' . $the_type])) { $this->current_sidebars = $settings['default_' . $the_type]['sidebars']; $this->current_position = $settings['default_' . $the_type]['position']; return; } } if (is_category()) { global $cat; if (isset($settings['by_id_category'][$cat])) { $this->current_sidebars = $settings['by_id_category'][$cat]['sidebars']; $this->current_position = $settings['by_id_category'][$cat]['position']; return; } else { if (isset($settings['by_id_category'])) { foreach ($settings['by_id_category'] as $key => $val) { $split_ids = explode(',', $key); if (in_array($cat, $split_ids)) { $this->current_sidebars = $settings['by_id_category'][$key]['sidebars']; $this->current_position = $settings['by_id_category'][$key]['position']; return; } } } } if (isset($settings['default_category'])) { $this->current_sidebars = $settings['default_category']['sidebars']; $this->current_position = $settings['default_category']['position']; return; } } if (is_tax()) { $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); if ($term && !is_wp_error($term)) { $is_in_multi = isset($settings['by_id_' . $term->taxonomy]) ? $this->is_in_multi_terms($settings['by_id_' . $term->taxonomy], $term->term_id) : false; if (isset($settings['by_id_' . $term->taxonomy][$term->term_id])) { $this->current_sidebars = $settings['by_id_' . $term->taxonomy][$term->term_id]['sidebars']; $this->current_position = $settings['by_id_' . $term->taxonomy][$term->term_id]['position']; return; } elseif ($is_in_multi) { $this->current_sidebars = $settings['by_id_' . $term->taxonomy][$is_in_multi]['sidebars']; $this->current_position = $settings['by_id_' . $term->taxonomy][$is_in_multi]['position']; return; } if (isset($settings['default_' . $term->taxonomy])) { $this->current_sidebars = $settings['default_' . $term->taxonomy]['sidebars']; $this->current_position = $settings['default_' . $term->taxonomy]['position']; return; } } } if (is_archive()) { if (isset($settings['default_is_archive'])) { $this->current_sidebars = $settings['default_is_archive']['sidebars']; $this->current_position = $settings['default_is_archive']['position']; return; } } if (is_search()) { if (isset($settings['default_is_search'])) { $this->current_sidebars = $settings['default_is_search']['sidebars']; $this->current_position = $settings['default_is_search']['position']; return; } } if (is_404()) { if (isset($settings['default_is_404'])) { $this->current_sidebars = $settings['default_is_404']['sidebars']; $this->current_position = $settings['default_is_404']['position']; return; } } if (isset($settings['default_is_default'])) { $this->current_sidebars = $settings['default_is_default']['sidebars']; $this->current_position = $settings['default_is_default']['position']; return; } else { $sidebar_cfg = $this->get->ext_config($this->_the_class_name, 'base'); for ($i = 0; $i < $sidebar_cfg['max_placeholders']; $i++) { $this->current_sidebars[$i] = array(); $this->current_position = NULL; } } }