Adding Custom Columns to Post Types?
-
I have the following code in the functions.php adding a custom post type of Functions and custom for taxonomies Movies.
// Custom Posts Type Features, including custom category name function post_type_features() { register_post_type('features', array( 'labels' => array( 'name' => __( 'Features' ), 'singular_name' => __( 'Features' ), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Features' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Features' ), 'new_item' => __( 'New Features' ), 'view' => __( 'View Features' ), 'view_item' => __( 'View Features' ), 'search_items' => __( 'Search Features' ), 'not_found' => __( 'No Features found' ), 'not_found_in_trash' => __( 'No Features found in Trash' ), 'parent' => __( 'Parent Features' ), ), 'public' => true, 'show_ui' => true, 'exclude_from_search' => true, 'hierarchical' => true, 'supports' => array( 'title', 'editor', 'thumbnail' ), 'query_var' => true ) ); } add_action('init', 'post_type_features'); add_action( 'init', 'create_features_taxonomies', 0 ); function create_features_taxonomies() { // Add new taxonomy, make it hierarchical (like categories) $labels = array( 'name' => _x( 'Movies', 'taxonomy general name' ), 'singular_name' => _x( 'Name', 'taxonomy singular name' ), 'search_items' => __( 'Search Names' ), 'popular_items' => __( 'Popular Names' ), 'all_items' => __( 'All Names' ), 'parent_item' => __( 'Parent Name' ), 'parent_item_colon' => __( 'Parent Name:' ), 'edit_item' => __( 'Edit Name' ), 'update_item' => __( 'Update Name' ), 'add_new_item' => __( 'Add New Movie' ), 'new_item_name' => __( 'New Name Movie' ), ); register_taxonomy('Names',array('features'), array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'Names' ), )); }
Is there any way i can add some custom columns for the page in the admin where it lists all the posts?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding Custom Columns to Post Types?’ is closed to new replies.