CPT – Portfolio projecten

Home » Snippets » CPT – Portfolio projecten
0

Created with:

Post Type Generator

Visibility: 

public

Creator: Ann-Sophie

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
				/**
 * Registers a custom post type 'portfolio'.
 *
 * @since 1.0.0
 *
 * @return void
 */
function register_portfolio_projecten() : void {
	$labels = [
		'name' => _x( 'Projects', 'Post Type General Name', 'annsophie' ),
		'singular_name' => _x( 'Project', 'Post Type Singular Name', 'annsophie' ),
		'menu_name' => __( 'Projects', 'annsophie' ),
		'name_admin_bar' => __( 'Projects', 'annsophie' ),
		'archives' => __( 'Projects Archives', 'annsophie' ),
		'attributes' => __( 'Projects Attributes', 'annsophie' ),
		'parent_item_colon' => __( 'Parent Project:', 'annsophie' ),
		'all_items' => __( 'All Projects', 'annsophie' ),
		'add_new_item' => __( 'Add New Project', 'annsophie' ),
		'add_new' => __( 'Nieuw toevoegen', 'annsophie' ),
		'new_item' => __( 'New Project', 'annsophie' ),
		'edit_item' => __( 'Edit Project', 'annsophie' ),
		'update_item' => __( 'Update Project', 'annsophie' ),
		'view_item' => __( 'View Project', 'annsophie' ),
		'view_items' => __( 'View Projects', 'annsophie' ),
		'search_items' => __( 'Search Projects', 'annsophie' ),
		'not_found' => __( 'Project Not Found', 'annsophie' ),
		'not_found_in_trash' => __( 'Project Not Found in Trash', 'annsophie' ),
		'featured_image' => __( 'Uitgelichte afbeelding', 'annsophie' ),
		'set_featured_image' => __( 'Stel uitgelichte afbeelding in', 'annsophie' ),
		'remove_featured_image' => __( 'Verwijder uitgelichte afbeelding', 'annsophie' ),
		'use_featured_image' => __( 'Gebruik als uitgelichte afbeelding', 'annsophie' ),
		'insert_into_item' => __( 'Insert into Project', 'annsophie' ),
		'uploaded_to_this_item' => __( 'Uploaded to this Project', 'annsophie' ),
		'items_list' => __( 'Projects List', 'annsophie' ),
		'items_list_navigation' => __( 'Projects List Navigation', 'annsophie' ),
		'filter_items_list' => __( 'Filter Projects List', 'annsophie' ),
	];
	$labels = apply_filters( 'portfolio-labels', $labels );

	$args = [
		'label' => __( 'Project', 'annsophie' ),
		'description' => __( 'Projecten', 'annsophie' ),
		'labels' => $labels,
		'supports' => [
			'title',
			'editor',
			'thumbnail',
		],
		'hierarchical' => false,
		'public' => true,
		'show_ui' => true,
		'show_in_menu' => true,
		'menu_position' => 20,
		'menu_icon' => 'dashicons-portfolio',
		'show_in_admin_bar' => false,
		'show_in_nav_menus' => true,
		'publicly_queryable' => true,
		'exclude_from_search' => false,
		'has_archive' => true,
		'can_export' => false,
		'capability_type' => 'post',
		'show_in_rest' => true,
	];
	$args = apply_filters( 'portfolio-args', $args );

	register_post_type( 'portfolio', $args );
}
add_action( 'init', 'register_portfolio_projecten', 0 );
			

Register an account to save your snippets or go Pro to get more features.