Advertisement
Guest User

Untitled

a guest
Dec 18th, 2010
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.77 KB | None | 0 0
  1. /* SETUP TAXONOMIES
  2. ======================================== */
  3. function mfields_create_taxonomies() {
  4.     register_taxonomy( "wordpress-functions", 'post', array(
  5.         'hierarchical' => true,
  6.         'show_tagcloud' => false,
  7.         'update_count_callback' => '_update_post_term_count',
  8.         'labels' => array(
  9.             'name'              => 'Functions',
  10.             'singular_name'     => 'Function',
  11.             'search_items'      => 'Search Function',
  12.             'all_items'         => 'All Function',
  13.             'parent_item'       => 'Parent Function',
  14.             'parent_item_colon' => 'Parent Function:',
  15.             'edit_item'         => 'Edit Function',
  16.             'update_item'       => 'Update Function',
  17.             'add_new_item'      => 'Add a New Function',
  18.             'new_item_name'     => 'New Function'
  19.             )
  20.         ) );
  21.     register_taxonomy( "wordpress-hooks", 'post', array(
  22.         'hierarchical' => true,
  23.         'show_tagcloud' => false,
  24.         'update_count_callback' => '_update_post_term_count',
  25.         'labels' => array(
  26.             'name'              => 'Hooks',
  27.             'singular_name'     => 'Hook',
  28.             'search_items'      => 'Search Hook',
  29.             'all_items'         => 'All Hook',
  30.             'parent_item'       => 'Parent Hook',
  31.             'parent_item_colon' => 'Parent Hook:',
  32.             'edit_item'         => 'Edit Hook',
  33.             'update_item'       => 'Update Hook',
  34.             'add_new_item'      => 'Add a New Hook',
  35.             'new_item_name'     => 'New Hook Name'
  36.             )
  37.         ) );
  38.     register_taxonomy( "topics", 'post', array(
  39.         'hierarchical' => true,
  40.         'show_tagcloud' => false,
  41.         'update_count_callback' => '_update_post_term_count',
  42.         'labels' => array(
  43.             'name'              => 'Topics',
  44.             'singular_name'     => 'Topic',
  45.             'search_items'      => 'Search Topics',
  46.             'all_items'         => 'All Topics',
  47.             'parent_item'       => 'Parent Topic',
  48.             'parent_item_colon' => 'Parent Topic:',
  49.             'edit_item'         => 'Edit Topic',
  50.             'update_item'       => 'Update Topic',
  51.             'add_new_item'      => 'Add a New Topic',
  52.             'new_item_name'     => 'New Topic Name'
  53.             )
  54.         ) );
  55.     register_taxonomy_for_object_type( 'topics', 'page' );
  56. }
  57. add_action( 'init', 'mfields_create_taxonomies', 1 );
  58.  
  59.        
  60.  
  61.  
  62.  
  63. /**
  64.  * Register linear post_type "Bookmark".
  65.  * @uses register_post_type()
  66.  */
  67. function mfields_register_bookmark_post_type() {
  68.     register_post_type( 'mfields_bookmark', array(
  69.         'public'        => true,
  70.         'can_export'    => true,
  71.         'has_archive'   => 'bookmarks',
  72.         'rewrite'       => array( 'slug' => 'bookmark', 'with_front' => false ),
  73.         'menu_position' => 3,
  74.         'supports' => array(
  75.             'title',
  76.             'editor',
  77.             'thumbnail',
  78.             'custom-fields'
  79.             ),
  80.         'labels' => array(
  81.             'name'               => 'Bookmarks',
  82.             'singular_name'      => 'Bookmark',
  83.             'add_new'            => 'Add New',
  84.             'add_new_item'       => 'Add New Bookmark',
  85.             'edit_item'          => 'Edit Bookmark',
  86.             'new_item'           => 'New Bookmark',
  87.             'view_item'          => 'View Bookmark',
  88.             'search_items'       => 'Search Bookmark',
  89.             'not_found'          => 'No Bookmarks found',
  90.             'not_found_in_trash' => 'No Bookmarks found in Trash'
  91.             )
  92.         )
  93.     );
  94. }
  95. add_action( 'init', 'mfields_register_bookmark_post_type', 0 );
  96.  
  97.  
  98. /**
  99.  * Register taxonomies for the "Bookmark" post_type.
  100.  * @uses register_taxonomy()
  101.  */
  102. function mfields_register_bookmark_taxonomies() {
  103.     register_taxonomy( 'mfields_bookmark_type', 'mfields_bookmark', array(
  104.         'hierarchical' => true,
  105.         'query_var' => 'type',
  106.         'rewrite' => array( 'slug' => 'type' ),
  107.         'show_tagcloud' => false,
  108.         'update_count_callback' => '_update_post_term_count',
  109.         'labels' => array(
  110.             'name'              => 'Types',
  111.             'singular_name'     => 'Type',
  112.             'search_items'      => 'Search Types',
  113.             'all_items'         => 'All Types',
  114.             'parent_item'       => 'Parent Type',
  115.             'parent_item_colon' => 'Parent Type:',
  116.             'edit_item'         => 'Edit Type',
  117.             'update_item'       => 'Update Type',
  118.             'add_new_item'      => 'Add a New Type',
  119.             'new_item_name'     => 'New Type Name'
  120.             )
  121.         ) );
  122.     register_taxonomy( 'mfields_bookmark_source', 'mfields_bookmark', array(
  123.         'hierarchical'          => true,
  124.         'query_var'             => 'source',
  125.         'rewrite'               => array( 'slug' => 'source' ),
  126.         'show_tagcloud'         => true,
  127.         'update_count_callback' => '_update_post_term_count',
  128.         'labels' => array(
  129.             'name'              => 'Sources',
  130.             'singular_name'     => 'Source',
  131.             'search_items'      => 'Search Sources',
  132.             'all_items'         => 'All Sources',
  133.             'parent_item'       => 'Parent Source',
  134.             'parent_item_colon' => 'Parent Source:',
  135.             'edit_item'         => 'Edit Source',
  136.             'update_item'       => 'Update Source',
  137.             'add_new_item'      => 'Add a New Source',
  138.             'new_item_name'     => 'New Source'
  139.             )
  140.         ) );
  141.     register_taxonomy_for_object_type( 'topics', 'mfields_bookmark' );
  142. }
  143. add_action( 'init', 'mfields_register_bookmark_taxonomies', 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement