Plugin Directory

Changeset 853658


Ignore:
Timestamp:
02/08/2014 11:00:30 AM (12 years ago)
Author:
saju79shyni
Message:

updates

Location:
add-sub-posts/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • add-sub-posts/trunk/inital.php

    r853645 r853658  
    8383add_action('init', 'post_type_tabs_children');
    8484
    85 
    86 function add_project_taxonomies() {
    87 
    88 // POST TYPE POST, SPEAKERS
    89     register_taxonomy('project_category', 'project', array(
    90         'hierarchical' => true,
    91         'labels' => array( 'name' => _x( 'Project Categories', 'taxonomy general name') ),
    92         'singular_name' => _x( 'Project Categories', 'taxonomy singular name'),
    93         'search_items' => __( 'Search Project Categories' ),
    94         'all_items' => __( 'All Project Categories'),
    95         'parent_item' => __( 'Parent Project Category' ),
    96         'parent_item_colon' => __( 'Parent Project Category'),
    97         'edit_item' => __( 'Edit Project Category'),
    98         'update_item' => __( 'Update Project Category' ),
    99         'add_new_item' => __( 'Add New Project Categories'),
    100         'new_item_name' => __( 'New Project Category'),
    101         'menu_name' => __( 'Project Categories'),
    102         'rewrite' => array( 'slug' => 'project-category','with_front' => false, 'hierarchical' => true ),
    103     ));
    104 
    105 }
    106 add_action( 'init', 'add_project_taxonomies', 0 );
     85function people_init() {
     86    // create a new taxonomy
     87
     88
     89    // Add new taxonomy, NOT hierarchical (like tags)
     90    $labels = array(
     91        'name'                       => _x( 'Project Categories', 'taxonomy general name' ),
     92        'singular_name'              => _x( 'Project Category', 'taxonomy singular name' ),
     93        'search_items'               => __( 'Search Project Categories' ),
     94        'popular_items'              => __( 'Popular Project Categories' ),
     95        'all_items'                  => __( 'All Project Categories' ),
     96        'parent_item'                => null,
     97        'parent_item_colon'          => null,
     98        'edit_item'                  => __( 'Edit Project Category' ),
     99        'update_item'                => __( 'Update Project Category' ),
     100        'add_new_item'               => __( 'Add New Project Category' ),
     101        'new_item_name'              => __( 'New Project Category' ),
     102        'separate_items_with_commas' => __( 'Separate Project Categories with commas' ),
     103        'add_or_remove_items'        => __( 'Add or remove Project Categories' ),
     104        'choose_from_most_used'      => __( 'Choose from the most used Project Categories' ),
     105        'not_found'                  => __( 'No Project Category found.' ),
     106        'menu_name'                  => __( 'Project Categories' ),
     107    );
     108
     109    $args = array(
     110        'hierarchical'          => true,
     111        'labels'                => $labels,
     112        'show_ui'               => true,
     113        'show_admin_column'     => true,
     114        'update_count_callback' => '_update_post_term_count',
     115        'query_var'             => true,
     116        'rewrite'               => array( 'slug' => 'project-category' ),
     117    );
     118
     119    register_taxonomy( 'project_category', 'project', $args );
     120}
     121add_action( 'init', 'people_init' );
    107122// Remove the children menu item as it will be managed under the parent item.
    108123function remove_tabs_children_menu() {
     
    149164
    150165
    151 // Include custom single template file for parent post type
    152 // Thanks to http://www.unfocus.com/2010/08/10/including-page-templates-from-a-wordpress-plugin/
    153166
    154167function locate_plugin_template_tabs($template_names, $load = false, $require_once = true )
  • add-sub-posts/trunk/redme.txt

    r853651 r853658  
    11=== add-sub-posts ===
    22Contributors: saju79shyni
    3 Tags: wordpress, sql
     3Tags: wordpress, sql,
    44Requires at least: 3.5.1
    55Tested up to: 3.8.1
    6 Stable tag: 2.0
     6Stable tag: 2.0.1
    77
    88Add sub post is a plugin that allows you to easily add childern posts to created Custom_post_type 'project'.
Note: See TracChangeset for help on using the changeset viewer.