/** * Creates the options for the select input. Puts the options in $this->settings['options'] * * @since 1.11 * * @return void */ public function create_select_options() { // Fetch post types. $post_types = tf_get_post_types($this->settings['public'], $this->settings['value']); $this->settings['options'] = array('' => '— ' . __('Select', TF_I18NDOMAIN) . ' —'); // Print all the other pages foreach ($post_types as $post_type) { if (!empty($post_type->labels->singular_name)) { $slugname = true == $this->settings['slug'] ? ' (' . $post_type->name . ')' : ''; $name = $post_type->labels->singular_name . $slugname; } else { $name = $post_type->name; } $this->settings['options'][$post_type->name] = $name; } }
public function registerCustomizerControl($wp_customize, $section, $priority = 1) { // Fetch post types. $post_types = tf_get_post_types($this->settings['public'], $this->settings['value']); $this->settings['options'] = array(); foreach ($post_types as $post_type) { $slug = $post_type->name; $slugname = true == $this->settings['slug'] ? ' (' . $slug . ')' : ''; $name = $post_type->name; if (!empty($post_type->labels->singular_name)) { $name = $post_type->labels->singular_name . ' (' . $slugname . ')'; } $this->settings['options'][$slug] = $name; } $wp_customize->add_control(new TitanFrameworkOptionMulticheckControl($wp_customize, $this->getID(), array('label' => $this->settings['name'], 'section' => $section->settings['id'], 'settings' => $this->getID(), 'description' => $this->settings['desc'], 'public' => $this->settings['public'], 'value' => $this->settings['value'], 'slug' => $this->settings['slug'], 'options' => $this->settings['options'], 'select_all' => $this->settings['select_all'], 'priority' => $priority))); }
$saved_names[$rel][$id] = $page->post_title; } 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);
<?php $tf_post_types = tf_get_post_types(); foreach ($tf_post_types as $key => $name) { $taxonomy = tf_custom_post_category($key); ?> <?php if ($taxonomy) { ?> <div class="multi_options multi_by_category_<?php echo $key; ?> "> <?php echo $this->optigen->multi(change_option_id_custom($taxonomy, $multi_options['custom_category'], 'sidebar_multi_select_' . $key . '_category')); ?> </div> <?php } ?> <div class="multi_options multi_by_id_<?php echo $key; ?> "> <?php echo $this->optigen->multi(change_option_id_custom($key, $multi_options['custom_post'], 'sidebar_multi_select_' . $key . '_' . $key)); ?>
public function build_select_options() { $sidebar_cfg = $this->get->ext_config($this->_the_class_name, 'base'); $select_options = $sidebar_cfg['select_options']; $out = array(); #add inbuilt post types to select menu foreach ($select_options['post_types'] as $key => $opts) { $out[$key] = $opts; } #now add the custom post types $custom_post_types = tf_get_post_types(); if (count($custom_post_types) > 0) { $tmp_post_opts = $sidebar_cfg['select_options']['post_types']['post']; foreach ($custom_post_types as $key => $name) { if (isset($sidebar_cfg['post_types'][$key])) { $tmp = $tmp_post_opts; $tmp['default_number'] = $sidebar_cfg['post_types'][$key]; $tmp['name'] = ucfirst($name); $out[$key] = $tmp; } else { $out[$key] = $tmp_post_opts; } } } #add inbuilt categories to select menu foreach ($select_options['categories'] as $key => $opts) { $out[$key] = $opts; } #add the custom taxonomies $custom_taxonomies = tf_get_taxonomies(); if (count($custom_taxonomies) > 0) { $tmp_taxonomy_opts = $sidebar_cfg['select_options']['categories']['category']; foreach ($custom_taxonomies as $key => $name) { if (isset($sidebar_cfg['taxonomies'][$key])) { $tmp = $tmp_taxonomy_opts; $tmp['default_number'] = $sidebar_cfg['taxonomies'][$key]; $tmp['name'] = ucfirst($name); $out[$key] = $tmp; } else { $out[$key] = $tmp_taxonomy_opts; } } } #add other options to select menu foreach ($select_options['other'] as $key => $opts) { $out[$key] = $opts; } $out2 = array(); foreach ($out as $key => $val) { if (!in_array($key, $sidebar_cfg['sidebar_disabled_types'])) { $out2[$key] = $val; } } return $out2; }