[ create a new paste ] login | about

Link: http://codepad.org/8SNMxaSD    [ raw code | output | fork ]

PHP, pasted on Jul 31:
add_action( 'init', 'create_post_type' );
function create_post_type() {
	register_post_type( 'video',
		array(
			'labels' => array(
				'name' => __( 'Videoer' ),
				'singular_name' => __( 'Video' ),
			),
			'capability_type' => 'Video',
			'capabilities' => array(
				'publish_posts' => 'publish_videos',
				'edit_posts' => 'edit_videos',
				'edit_others_posts' => 'edit_others_videos',
				'delete_posts' => 'delete_videos',
				'delete_others_posts' => 'delete_others_videos',
				'read_private_posts' => 'read_private_videos',
				'edit_post' => 'edit_video',
				'delete_post' => 'delete_video',
				'read_post' => 'read_video',
			),
		'public' => true,
		'menu_position' => 4,
		'has_archive' => true,
		'taxonomies' => array('post_tag', 'category'),
		'supports' => array('title', 'editor')
		)
	);
}


Output:
add_action( 'init', 'create_post_type' );
function create_post_type() {
	register_post_type( 'video',
		array(
			'labels' => array(
				'name' => __( 'Videoer' ),
				'singular_name' => __( 'Video' ),
			),
			'capability_type' => 'Video',
			'capabilities' => array(
				'publish_posts' => 'publish_videos',
				'edit_posts' => 'edit_videos',
				'edit_others_posts' => 'edit_others_videos',
				'delete_posts' => 'delete_videos',
				'delete_others_posts' => 'delete_others_videos',
				'read_private_posts' => 'read_private_videos',
				'edit_post' => 'edit_video',
				'delete_post' => 'delete_video',
				'read_post' => 'read_video',
			),
		'public' => true,
		'menu_position' => 4,
		'has_archive' => true,
		'taxonomies' => array('post_tag', 'category'),
		'supports' => array('title', 'editor')
		)
	);
}


Create a new paste based on this one


Comments: