From aef07828a6a6b5f0d68307cd9c24e9ddf2b0e4d5 Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Mon, 21 Oct 2019 15:01:41 -0700 Subject: [PATCH] Pledges: Adjust admin menu entries --- plugins/wporg-5ftf/includes/pledge.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/wporg-5ftf/includes/pledge.php b/plugins/wporg-5ftf/includes/pledge.php index 02d3eec..72db577 100755 --- a/plugins/wporg-5ftf/includes/pledge.php +++ b/plugins/wporg-5ftf/includes/pledge.php @@ -16,6 +16,7 @@ const SLUG_PL = 'pledges'; const CPT_ID = FiveForTheFuture\PREFIX . '_' . SLUG; add_action( 'init', __NAMESPACE__ . '\register', 0 ); +add_action( 'admin_menu', __NAMESPACE__ . '\admin_menu' ); /** * Register all the things. @@ -27,6 +28,15 @@ function register() { register_custom_post_status(); } +/** + * Adjustments to the Five for the Future admin menu. + * + * @return void + */ +function admin_menu() { + remove_submenu_page( 'edit.php?post_type=' . CPT_ID, 'post-new.php?post_type=' . CPT_ID ); +} + /** * Register the post type(s). * @@ -40,7 +50,7 @@ function register_custom_post_type() { 'archives' => __( 'Pledge Archives', 'wporg' ), 'attributes' => __( 'Pledge Attributes', 'wporg' ), 'parent_item_colon' => __( 'Parent Pledge:', 'wporg' ), - 'all_items' => __( 'All Pledges', 'wporg' ), + 'all_items' => __( 'Pledges', 'wporg' ), 'add_new_item' => __( 'Add New Pledge', 'wporg' ), 'add_new' => __( 'Add New', 'wporg' ), 'new_item' => __( 'New Pledge', 'wporg' ),