Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Max – Post Type – Popups

if ( ! function_exists('cntv_popup_post_type') ) {

// Register Custom Post Type
function cntv_popup_post_type() {

	$labels = array(
		'name'                  => _x( 'Popups', 'Post Type General Name', 'centivemax' ),
		'singular_name'         => _x( 'Popup', 'Post Type Singular Name', 'centivemax' ),
		'menu_name'             => __( 'Centive · Popups', 'centivemax' ),
		'name_admin_bar'        => __( 'Centive · Popups', 'centivemax' ),
		'archives'              => __( 'Arquivo de popups', 'centivemax' ),
		'attributes'            => __( 'Atributos da popup', 'centivemax' ),
		'parent_item_colon'     => __( 'Popup principal:', 'centivemax' ),
		'all_items'             => __( 'Todos as popups', 'centivemax' ),
		'add_new_item'          => __( 'Adicionar nova popup', 'centivemax' ),
		'add_new'               => __( 'Adicionar nova', 'centivemax' ),
		'new_item'              => __( 'Nova popup', 'centivemax' ),
		'edit_item'             => __( 'Editar popup', 'centivemax' ),
		'update_item'           => __( 'Atualizar popup', 'centivemax' ),
		'view_item'             => __( 'Ver popup', 'centivemax' ),
		'view_items'            => __( 'Ver popups', 'centivemax' ),
		'search_items'          => __( 'Buscar popup', 'centivemax' ),
		'not_found'             => __( 'Nada encontrado', 'centivemax' ),
		'not_found_in_trash'    => __( 'Nada encontrado na Lixeira', 'centivemax' ),
		'featured_image'        => __( 'Imagem destacada', 'centivemax' ),
		'set_featured_image'    => __( 'Escolher imagem destacada', 'centivemax' ),
		'remove_featured_image' => __( 'Remover imagem destacada', 'centivemax' ),
		'use_featured_image'    => __( 'Usar como imagem destacada', 'centivemax' ),
		'insert_into_item'      => __( 'Inserir na popup', 'centivemax' ),
		'uploaded_to_this_item' => __( 'Carregado para esta popup', 'centivemax' ),
		'items_list'            => __( 'Lista das popups', 'centivemax' ),
		'items_list_navigation' => __( 'Navegação de lista das popups', 'centivemax' ),
		'filter_items_list'     => __( 'Filtrar lista de popups', 'centivemax' ),
	);
	$capabilities = array(
		'edit_post'             => 'update_core',
		'read_post'             => 'update_core',
		'delete_post'           => 'update_core',
		'edit_posts'            => 'update_core',
		'edit_others_posts'     => 'update_core',
		'publish_posts'         => 'update_core',
		'read_private_posts'    => 'update_core',
	);
	$args = array(
		'label'                 => __( 'Popup', 'centivemax' ),
		'description'           => __( 'Crie Popups personalizadas', 'centivemax' ),
		'labels'                => $labels,
		'supports'              => array( 'title' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 100,
		'menu_icon'             => 'dashicons-star-filled',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => false,
		'exclude_from_search'   => true,
		'publicly_queryable'    => true,
		'capabilities'          => $capabilities,
		'show_in_rest'          => false,
	);
	register_post_type( 'cntv-popup', $args );

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

}