multiple custom posts array
-
Is there a way i can instead of declaring 3 different custom post types all with the same attributes. bunch them into an array
so instead this
register_post_type('portfolio', array( 'label' => 'Films & Media', 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => true, 'rewrite' => array('slug' => 'portfolio'), 'query_var' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments'), )); register_post_type('blog', array( 'label' => 'Blog', 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => true, 'rewrite' => array('slug' => 'blog'), 'query_var' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments',), )); register_post_type('tile_one', array( 'label' => 'Tile One', 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => true, 'rewrite' => array('slug' => 'tile_one'), 'query_var' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions'), ));I want to do something like this
register_post_type('portfolio', 'blog', 'news', 'etc' array( 'label' => 'portfolio', 'blog', 'news', 'etc' 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => true, 'rewrite' => array('slug' => 'portfolio', 'blog', 'news', 'etc'), 'query_var' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments'), ));Any help much appreciated
The topic ‘multiple custom posts array’ is closed to new replies.