Advertisements

create_initial_taxonomies

Definition:
function create_initial_taxonomies() {}

Creates the initial taxonomies when ‘init’ action is fired.

Defined filters

  • post_format_rewrite_base
    apply_filters( 'post_format_rewrite_base', 'type' )

Source code

function create_initial_taxonomies() {

	global $wp_rewrite;



	register_taxonomy( 'category', 'post', array(

		'hierarchical' => true,

		'query_var' => 'category_name',

		'rewrite' => did_action( 'init' ) ? array(

					'hierarchical' => true,

					'slug' => get_option('category_base') ? get_option('category_base') : 'category',

					'with_front' => ( get_option('category_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true ) : false,

		'public' => true,

		'show_ui' => true,

		'_builtin' => true,

	) );



	register_taxonomy( 'post_tag', 'post', array(

	 	'hierarchical' => false,

		'query_var' => 'tag',

		'rewrite' => did_action( 'init' ) ? array(

					'slug' => get_option('tag_base') ? get_option('tag_base') : 'tag',

					'with_front' => ( get_option('tag_base') && ! $wp_rewrite->using_index_permalinks() ) ? false : true ) : false,

		'public' => true,

		'show_ui' => true,

		'_builtin' => true,

	) );



	register_taxonomy( 'nav_menu', 'nav_menu_item', array(

		'public' => false,

		'hierarchical' => false,

		'labels' => array(

			'name' => __( 'Navigation Menus' ),

			'singular_name' => __( 'Navigation Menu' ),

		),

		'query_var' => false,

		'rewrite' => false,

		'show_ui' => false,

		'_builtin' => true,

		'show_in_nav_menus' => false,

	) );



	register_taxonomy( 'link_category', 'link', array(

		'hierarchical' => false,

		'labels' => array(

			'name' => __( 'Link Categories' ),

			'singular_name' => __( 'Link Category' ),

			'search_items' => __( 'Search Link Categories' ),

			'popular_items' => null,

			'all_items' => __( 'All Link Categories' ),

			'edit_item' => __( 'Edit Link Category' ),

			'update_item' => __( 'Update Link Category' ),

			'add_new_item' => __( 'Add New Link Category' ),

			'new_item_name' => __( 'New Link Category Name' ),

			'separate_items_with_commas' => null,

			'add_or_remove_items' => null,

			'choose_from_most_used' => null,

		),

		'query_var' => false,

		'rewrite' => false,

		'public' => false,

		'show_ui' => false,

		'_builtin' => true,

	) );



	$rewrite = false;

	if ( did_action( 'init' ) ) {

		$rewrite = apply_filters( 'post_format_rewrite_base', 'type' );

		$rewrite = $rewrite ? array( 'slug' => $rewrite ) : false;

	}



	register_taxonomy( 'post_format', 'post', array(

		'public' => true,

		'hierarchical' => false,

		'labels' => array(

			'name' => _x( 'Format', 'post format' ),

			'singular_name' => _x( 'Format', 'post format' ),

		),

		'query_var' => true,

		'rewrite' => $rewrite,

		'show_ui' => false,

		'_builtin' => true,

		'show_in_nav_menus' => false,

	) );

}

744

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: