Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ia-epic): Adjustments to Menu for Information Architecture UI #487

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 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,6 +110,8 @@ public static function add_plugin_page() {
35
);

// @ todo: possibly remove category and tags since these just redirect to Posts categories/tags.

// Custom taxonomy menu links.
add_submenu_page(
'newspack-listings',
Expand Down Expand Up @@ -192,25 +196,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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Move Marketplace above Generic here so that admin submenu will show Marketplace above Generic.

I don't think this comment is necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @miguelpeixe for removing the category/tax links. As for the comment // Move Marketplace above Generic ... I agree the comment can be removed. I put it there because "everywhere else" in the plugin Generic is coded above Marketplace. But I'm totally cool with whatever you decide :-)

'marketplace' => [
'labels' => [
'name' => _x( 'Marketplace', 'post type general name', 'newspack-listings' ),
Expand All @@ -230,6 +216,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