コード例 #1
0
ファイル: functions.php プロジェクト: aragonc/3clicks
 public function add_tag_support()
 {
     $features = array('g1-archive-settings', 'g1-archive-template', 'g1-global-archive-template', 'g1-individual-archive-template', 'g1-global-archive-sidebar-1', 'g1-individual-archive-sidebar-1', 'g1-global-archive-posts-per-page', 'g1-individual-archive-posts-per-page', 'g1-collection-global-elements', 'g1-collection-individual-elements');
     foreach ($features as $feature) {
         add_taxonomy_support($this->get_tag_taxonomy(), $feature);
     }
 }
コード例 #2
0
ファイル: functions.php プロジェクト: aragonc/3clicks
 /**
  * Registers custom tag (taxonomy to be exact)
  *
  * If you want to modify some paremeters, hook into the g1_pre_register_custonomy custom filter.
  */
 public function register_tag()
 {
     $slug = sanitize_title(g1_get_theme_option('taxonomy_' . $this->get_tag_taxonomy(), 'rewrite_slug'));
     $slug = strlen($slug) ? $slug : 'work-tag';
     // Compose arguments for g1_work_tag
     $args = array('label' => __('Work Tag', 'g1_theme'), 'labels' => array('name' => __('Work Tags', 'g1_theme'), 'singular_name' => __('Work Tag', 'g1_theme'), 'search_items' => __('Search Work Tags', 'g1_theme'), 'popular_items' => __('Popular Work Tags', 'g1_theme'), 'all_items' => __('All Work Tags', 'g1_theme'), 'parent_item' => __('Parent Work Tag', 'g1_theme'), 'parent_item_colon' => __('Parent Work Tag:', 'g1_theme'), 'edit_item' => __('Edit Work Tag', 'g1_theme'), 'update_item' => __('Update Work Tag', 'g1_theme'), 'add_new_item' => __('Add New Work Tag', 'g1_theme'), 'new_item_name' => __('New Work Tag', 'g1_theme'), 'menu_name' => __('Work Tags', 'g1_theme')), 'query_var' => $this->get_tag_taxonomy(), 'rewrite' => array('slug' => _x($slug, 'URL slug', 'g1_theme'), 'with_front' => true), 'public' => true, 'hierarchical' => false, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true);
     // Apply custom filters (this way Child Themes can change some arguments)
     $args = apply_filters('g1_pre_register_taxonomy', $args, $this->get_category_taxonomy());
     register_taxonomy($this->get_tag_taxonomy(), array($this->get_post_type()), $args);
     $features = array('g1-archive-settings', 'g1-global-rewrite-slug', 'g1-global-archive-template', 'g1-individual-archive-template', 'g1-global-archive-posts-per-page', 'g1-individual-archive-posts-per-page', 'g1-global-archive-sidebar-1', 'g1-individual-archive-sidebar-1', 'g1-collection-global-elements', 'g1-collection-individual-elements', 'g1-single-entry-settings', 'g1-single-entry-template');
     foreach ($features as $feature) {
         add_taxonomy_support($this->get_tag_taxonomy(), $feature);
     }
 }