Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Custom Post Type – Clientes

Entradas personalizadas de WordPress para clientes

// Register Custom Post Type
function clientes_post_type() {

	$labels = array(
		'name'                  => _x( 'Clientes', 'Post Type General Name', 'clientes_domain' ),
		'singular_name'         => _x( 'Cliente', 'Post Type Singular Name', 'clientes_domain' ),
		'menu_name'             => __( 'Clientes', 'clientes_domain' ),
		'name_admin_bar'        => __( 'Clientes', 'clientes_domain' ),
		'archives'              => __( 'Lista de clientes', 'clientes_domain' ),
		'attributes'            => __( 'Atributos de clientes', 'clientes_domain' ),
		'parent_item_colon'     => __( 'Cliente padre:', 'clientes_domain' ),
		'all_items'             => __( 'All Items', 'clientes_domain' ),
		'add_new_item'          => __( 'Añadir nuevo', 'clientes_domain' ),
		'add_new'               => __( 'Añadir', 'clientes_domain' ),
		'new_item'              => __( 'Nuevo', 'clientes_domain' ),
		'edit_item'             => __( 'Editar', 'clientes_domain' ),
		'update_item'           => __( 'Actualizar', 'clientes_domain' ),
		'view_item'             => __( 'Ver cliente', 'clientes_domain' ),
		'view_items'            => __( 'Ver clientes', 'clientes_domain' ),
		'search_items'          => __( 'Buscar cliente', 'clientes_domain' ),
		'not_found'             => __( 'No encontrado', 'clientes_domain' ),
		'not_found_in_trash'    => __( 'No encontrado en la papelera', 'clientes_domain' ),
		'featured_image'        => __( 'Imagen destacada', 'clientes_domain' ),
		'set_featured_image'    => __( 'Asignar imagen destacada', 'clientes_domain' ),
		'remove_featured_image' => __( 'Remover imagen', 'clientes_domain' ),
		'use_featured_image'    => __( 'Usar como imagen destacada', 'clientes_domain' ),
		'insert_into_item'      => __( 'Insertar en clientes', 'clientes_domain' ),
		'uploaded_to_this_item' => __( 'Añadir a clientes', 'clientes_domain' ),
		'items_list'            => __( 'Lista de clientes', 'clientes_domain' ),
		'items_list_navigation' => __( 'Navegación clientes', 'clientes_domain' ),
		'filter_items_list'     => __( 'Filtro de clientes', 'clientes_domain' ),
	);
	$rewrite = array(
		'slug'                  => 'cliente',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'Cliente', 'clientes_domain' ),
		'description'           => __( 'Clientes de Yuneux', 'clientes_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor' ),
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-groups',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => true,
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'rewrite'               => $rewrite,
		'capability_type'       => 'page',
		'show_in_rest'          => true,
	);
	register_post_type( 'clientes_post_type', $args );

}
add_action( 'init', 'clientes_post_type', 0 );