GFPT Plan post type
for GFPT plugin
// Register Custom Post Type
function gfpt_plan_post_type() {
$labels = array(
'name' => _x( 'Plans', 'Post Type General Name', 'gf-pricingtableaddon' ),
'singular_name' => _x( 'Plan', 'Post Type Singular Name', 'gf-pricingtableaddon' ),
'menu_name' => __( 'Foms Pricing Tables', 'gf-pricingtableaddon' ),
'name_admin_bar' => __( 'Foms Pricing Tables', 'gf-pricingtableaddon' ),
'archives' => __( 'Plan Archives', 'gf-pricingtableaddon' ),
'attributes' => __( 'Plan Attributes', 'gf-pricingtableaddon' ),
'parent_item_colon' => __( 'Parent Plan:', 'gf-pricingtableaddon' ),
'all_items' => __( 'All Plans', 'gf-pricingtableaddon' ),
'add_new_item' => __( 'Add New Plan', 'gf-pricingtableaddon' ),
'add_new' => __( 'Add Plan', 'gf-pricingtableaddon' ),
'new_item' => __( 'New Plan', 'gf-pricingtableaddon' ),
'edit_item' => __( 'Edit Plan', 'gf-pricingtableaddon' ),
'update_item' => __( 'Update Plan', 'gf-pricingtableaddon' ),
'view_item' => __( 'View Plan', 'gf-pricingtableaddon' ),
'view_items' => __( 'View Plans', 'gf-pricingtableaddon' ),
'search_items' => __( 'Search Plan', 'gf-pricingtableaddon' ),
'not_found' => __( 'Plans not found', 'gf-pricingtableaddon' ),
'not_found_in_trash' => __( 'Plans not found in Trash', 'gf-pricingtableaddon' ),
'featured_image' => __( 'Featured Image', 'gf-pricingtableaddon' ),
'set_featured_image' => __( 'Set featured image', 'gf-pricingtableaddon' ),
'remove_featured_image' => __( 'Remove featured image', 'gf-pricingtableaddon' ),
'use_featured_image' => __( 'Use as featured image', 'gf-pricingtableaddon' ),
'insert_into_item' => __( 'Insert into plan', 'gf-pricingtableaddon' ),
'uploaded_to_this_item' => __( 'Uploaded to this plan', 'gf-pricingtableaddon' ),
'items_list' => __( 'Plans list', 'gf-pricingtableaddon' ),
'items_list_navigation' => __( 'Plans list navigation', 'gf-pricingtableaddon' ),
'filter_items_list' => __( 'Filter plans list', 'gf-pricingtableaddon' ),
);
$capabilities = array(
'edit_post' => 'manage_options',
'read_post' => 'read_post',
'delete_post' => 'manage_options',
'edit_posts' => 'manage_options',
'edit_others_posts' => 'manage_options',
'publish_posts' => 'manage_options',
'read_private_posts' => 'read_private_posts',
);
$args = array(
'label' => __( 'Plan', 'gf-pricingtableaddon' ),
'description' => __( 'The plan post type for GravityForms Pricing Table', 'gf-pricingtableaddon' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ),
'taxonomies' => array( 'category' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 20,
'menu_icon' => 'dashicons-exerpt-view',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capabilities' => $capabilities,
'show_in_rest' => true,
);
register_post_type( 'gfpt_plan', $args );
}
add_action( 'init', 'gfpt_plan_post_type', 0 );