0
X
Add Snippet To Project
New Project
Add To Existing Project
/**
* Registers a custom post type 'ng1-animation'.
*
* @since 1.0.0
*
* @return void
*/
function register_animation_post_type() : void {
$labels = [
'name' => _x( 'Gsap animations', 'Post Type General Name', 'ng1' ),
'singular_name' => _x( 'Gsap animation', 'Post Type Singular Name', 'ng1' ),
'menu_name' => __( 'Gsap animations', 'ng1' ),
'name_admin_bar' => __( 'Gsap animations', 'ng1' ),
'archives' => __( 'Gsap animations Archives', 'ng1' ),
'attributes' => __( 'Gsap animations Attributes', 'ng1' ),
'parent_item_colon' => __( 'Parent Gsap animation:', 'ng1' ),
'all_items' => __( 'All Gsap animations', 'ng1' ),
'add_new_item' => __( 'Add New Gsap animation', 'ng1' ),
'add_new' => __( 'Add New', 'ng1' ),
'new_item' => __( 'New Gsap animation', 'ng1' ),
'edit_item' => __( 'Edit Gsap animation', 'ng1' ),
'update_item' => __( 'Update Gsap animation', 'ng1' ),
'view_item' => __( 'View Gsap animation', 'ng1' ),
'view_items' => __( 'View Gsap animations', 'ng1' ),
'search_items' => __( 'Search Gsap animations', 'ng1' ),
'not_found' => __( 'Gsap animation Not Found', 'ng1' ),
'not_found_in_trash' => __( 'Gsap animation Not Found in Trash', 'ng1' ),
'featured_image' => __( 'Featured Image', 'ng1' ),
'set_featured_image' => __( 'Set Featured Image', 'ng1' ),
'remove_featured_image' => __( 'Remove Featured Image', 'ng1' ),
'use_featured_image' => __( 'Use as Featured Image', 'ng1' ),
'insert_into_item' => __( 'Insert into Gsap animation', 'ng1' ),
'uploaded_to_this_item' => __( 'Uploaded to this Gsap animation', 'ng1' ),
'items_list' => __( 'Gsap animations List', 'ng1' ),
'items_list_navigation' => __( 'Gsap animations List Navigation', 'ng1' ),
'filter_items_list' => __( 'Filter Gsap animations List', 'ng1' ),
];
$labels = apply_filters( 'ng1-animation-labels', $labels );
$args = [
'label' => __( 'Gsap animation', 'ng1' ),
'description' => __( 'Animation GSAP', 'ng1' ),
'labels' => $labels,
'supports' => [
'title',
'editor',
],
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-post',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'exclude_from_search' => false,
'has_archive' => false,
'can_export' => false,
'capability_type' => 'page',
'show_in_rest' => true,
];
$args = apply_filters( 'ng1-animation-args', $args );
register_post_type( 'ng1-animation', $args );
}
add_action( 'init', 'register_animation_post_type', 0 );