mage-eventpress/inc/mep_cpt.php

62 lines
2.6 KiB
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
// Create MKB CPT
function mep_cpt() {
$labels = array(
'name' => _x( 'Events', 'mep' ),
'singular_name' => _x( 'Events', 'mep' ),
'menu_name' => __( 'Events', 'mep' ),
'name_admin_bar' => __( 'Events', 'mep' ),
'archives' => __( 'Events List', 'mep' ),
'attributes' => __( 'Events List', 'mep' ),
'parent_item_colon' => __( 'Event Item:', 'mep' ),
'all_items' => __( 'All Events', 'mep' ),
'add_new_item' => __( 'Add New Event', 'mep' ),
'add_new' => __( 'Add New Event', 'mep' ),
'new_item' => __( 'New Event', 'mep' ),
'edit_item' => __( 'Edit Event', 'mep' ),
'update_item' => __( 'Update Event', 'mep' ),
'view_item' => __( 'View Event', 'mep' ),
'view_items' => __( 'View Event', 'mep' ),
'search_items' => __( 'Search Event', 'mep' ),
'not_found' => __( 'Event Not found', 'mep' ),
'not_found_in_trash' => __( 'Event Not found in Trash', 'mep' ),
'featured_image' => __( 'Event Feature Image', 'mep' ),
'set_featured_image' => __( 'Set Event featured image', 'mep' ),
'remove_featured_image' => __( 'Remove Event featured image', 'mep' ),
'use_featured_image' => __( 'Use as Event featured image', 'mep' ),
'insert_into_item' => __( 'Insert into Event', 'mep' ),
'uploaded_to_this_item' => __( 'Uploaded to this Event', 'mep' ),
'items_list' => __( 'Event list', 'mep' ),
'items_list_navigation' => __( 'Event list navigation', 'mep' ),
'filter_items_list' => __( 'Filter Event list', 'mep' ),
);
$args = array(
'public' => true,
'labels' => $labels,
'menu_icon' => 'dashicons-calendar-alt',
'supports' => array('title','editor','thumbnail'),
'rewrite' => array('slug' => 'events')
);
register_post_type( 'mep_events', $args );
$argsl = array(
'public' => true,
'label' => 'Event Attendees',
'menu_icon' => 'dashicons-id',
'supports' => array('title'),
'show_in_menu' => 'edit.php?post_type=mep_events'
);
register_post_type( 'mep_events_attendees', $argsl );
}
add_action( 'init', 'mep_cpt' );