From a0f165672f377cd3302fd4d4474f6224bbc47f7b Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Wed, 5 Jan 2022 09:24:21 +0000 Subject: [PATCH] cpt filter update --- inc/mep_cpt.php | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/inc/mep_cpt.php b/inc/mep_cpt.php index 8720189..cc03599 100644 --- a/inc/mep_cpt.php +++ b/inc/mep_cpt.php @@ -42,15 +42,22 @@ function mep_cpt() 'items_list_navigation' => __($event_label . ' list navigation', 'mage-eventpress'), 'filter_items_list' => __('Filter ' . $event_label . ' list', 'mage-eventpress'), ); - + + $rewrite = array( + 'slug' => 'mage-events', + 'with_front' => true, + 'pages' => true, + 'feeds' => true, + ); + $args = array( 'public' => true, - 'has_archive' => true, + 'has_archive' => false, 'labels' => $labels, 'menu_icon' => $event_icon, 'supports' => apply_filters('mep_events_post_type_support',array('title', 'editor', 'thumbnail', 'excerpt')), - 'rewrite' => array('slug' => $event_slug), - 'show_in_rest' => true + 'rewrite' => $rewrite, + 'show_in_rest' => apply_filters('mep_events_post_type_show_in_rest',true) ); register_post_type('mep_events', $args); @@ -84,16 +91,21 @@ function mep_cpt() 'items_list_navigation' => __('Speaker list navigation', 'mage-eventpress'), 'filter_items_list' => __('Filter Speaker list', 'mage-eventpress'), ); - + $sprewrite = array( + 'slug' => 'event-speaker', + 'with_front' => true, + 'pages' => true, + 'feeds' => true, + ); + $args = array( 'public' => true, 'labels' => $labels, 'menu_icon' => 'dashicons-calendar-alt', 'supports' => array('title', 'editor', 'thumbnail', 'excerpt'), - 'rewrite' => array('slug' => 'event-speaker'), + 'rewrite' => $sprewrite, 'show_in_menu' => 'edit.php?post_type=mep_events', - 'show_in_rest' => true - + 'show_in_rest' => apply_filters('mep_speaker_post_type_show_in_rest',true) ); if ($speaker_status == 'yes') {