Skip to content

Commit

Permalink
feat(ia-epic): Adjustments to Menu for Information Architecture UI (#487
Browse files Browse the repository at this point in the history
)

Co-authored-by: Miguel Peixe <[email protected]>
  • Loading branch information
ronchambers and miguelpeixe authored Oct 31, 2024
1 parent 403abb0 commit 22b70d4
Showing 1 changed file with 22 additions and 35 deletions.
57 changes: 22 additions & 35 deletions includes/class-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public function __construct() {

/**
* Add options page.
*
* Note: with Newspack Plugin active and Information Architecture UI (2024): this callback is replaced.
*/
public static function add_plugin_page() {
// Top-level menu item.
Expand All @@ -108,22 +110,6 @@ public static function add_plugin_page() {
35
);

// Custom taxonomy menu links.
add_submenu_page(
'newspack-listings',
__( 'Newspack Listings: Categories', 'newspack-listings' ),
__( 'Categories', 'newspack-listings' ),
'manage_categories',
'edit-tags.php?taxonomy=category'
);
add_submenu_page(
'newspack-listings',
__( 'Newspack Listings: Tags', 'newspack-listings' ),
__( 'Tags', 'newspack-listings' ),
'manage_categories',
'edit-tags.php?taxonomy=post_tag'
);

// Settings menu link.
add_submenu_page(
'newspack-listings',
Expand Down Expand Up @@ -192,25 +178,7 @@ public static function register_post_types() {
'rewrite' => [ 'slug' => $prefix . $settings['newspack_listings_event_slug'] ],
'template' => [ [ 'newspack-listings/event-dates' ] ],
],
'generic' => [
'labels' => [
'name' => _x( 'Generic Listings', 'post type general name', 'newspack-listings' ),
'singular_name' => _x( 'Generic Listing', 'post type singular name', 'newspack-listings' ),
'menu_name' => _x( 'Generic Listings', 'admin menu', 'newspack-listings' ),
'name_admin_bar' => _x( 'Generic Listing', 'add new on admin bar', 'newspack-listings' ),
'add_new' => _x( 'Add New', 'popup', 'newspack-listings' ),
'add_new_item' => __( 'Add New Generic Listing', 'newspack-listings' ),
'new_item' => __( 'New Generic Listing', 'newspack-listings' ),
'edit_item' => __( 'Edit Generic Listing', 'newspack-listings' ),
'view_item' => __( 'View Generic Listing', 'newspack-listings' ),
'all_items' => __( 'Generic Listings', 'newspack-listings' ),
'search_items' => __( 'Search Generic Listings', 'newspack-listings' ),
'parent_item_colon' => __( 'Parent Generic Listing:', 'newspack-listings' ),
'not_found' => __( 'No generic listings found.', 'newspack-listings' ),
'not_found_in_trash' => __( 'No generic listings found in Trash.', 'newspack-listings' ),
],
'rewrite' => [ 'slug' => $prefix . $settings['newspack_listings_generic_slug'] ],
],
// Move Marketplace above Generic here so that admin submenu will show Marketplace above Generic.
'marketplace' => [
'labels' => [
'name' => _x( 'Marketplace', 'post type general name', 'newspack-listings' ),
Expand All @@ -230,6 +198,25 @@ public static function register_post_types() {
],
'rewrite' => [ 'slug' => $prefix . $settings['newspack_listings_marketplace_slug'] ],
],
'generic' => [
'labels' => [
'name' => _x( 'Generic Listings', 'post type general name', 'newspack-listings' ),
'singular_name' => _x( 'Generic Listing', 'post type singular name', 'newspack-listings' ),
'menu_name' => _x( 'Generic Listings', 'admin menu', 'newspack-listings' ),
'name_admin_bar' => _x( 'Generic Listing', 'add new on admin bar', 'newspack-listings' ),
'add_new' => _x( 'Add New', 'popup', 'newspack-listings' ),
'add_new_item' => __( 'Add New Generic Listing', 'newspack-listings' ),
'new_item' => __( 'New Generic Listing', 'newspack-listings' ),
'edit_item' => __( 'Edit Generic Listing', 'newspack-listings' ),
'view_item' => __( 'View Generic Listing', 'newspack-listings' ),
'all_items' => __( 'Generic Listings', 'newspack-listings' ),
'search_items' => __( 'Search Generic Listings', 'newspack-listings' ),
'parent_item_colon' => __( 'Parent Generic Listing:', 'newspack-listings' ),
'not_found' => __( 'No generic listings found.', 'newspack-listings' ),
'not_found_in_trash' => __( 'No generic listings found in Trash.', 'newspack-listings' ),
],
'rewrite' => [ 'slug' => $prefix . $settings['newspack_listings_generic_slug'] ],
],
'place' => [
'labels' => [
'name' => _x( 'Places', 'post type general name', 'newspack-listings' ),
Expand Down

0 comments on commit 22b70d4

Please sign in to comment.