Skip to content

Commit

Permalink
Merge pull request #2052 from CityOfPhiladelphia/reorganize-wp-dashbo…
Browse files Browse the repository at this point in the history
…ard-navigation

changed menu item highlighting & added sentence case
  • Loading branch information
RitikaDesai98 authored Dec 15, 2023
2 parents dd7b00a + 10b631e commit 1f905fb
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ function admin_menu_order( $menu_ord ) {
function phila_change_post_label() {
global $wp_post_types;
$labels = &$wp_post_types['post']->labels;
$labels->name = 'The latest news + events';
$labels->singular_name = 'Latest item';
$labels->name = 'News';
$labels->singular_name = 'News';
$labels->add_new = 'Add news item';
$labels->add_new_item = 'Add news item';
$labels->edit_item = 'Edit item';
Expand All @@ -101,8 +101,8 @@ function phila_change_post_label() {
function phila_change_page_label() {
global $wp_post_types;
$labels = &$wp_post_types['page']->labels;
$labels->name = 'Top-Level Pages';
$labels->singular_name = 'Top-Level Page';
$labels->name = 'Top-level pages';
$labels->singular_name = 'Top-level page';
$labels->add_new = 'Add top-level page';
$labels->add_new_item = 'Add top-level page';
$labels->edit_item = 'Edit top-level page';
Expand All @@ -112,7 +112,7 @@ function phila_change_page_label() {
$labels->not_found = 'Nothing found';
$labels->not_found_in_trash = 'Nothing found in trash';
$labels->all_items = 'All top-level pages';
$labels->menu_name = 'Top-Level Pages';
$labels->menu_name = 'Top-level pages';
$labels->name_admin_bar = 'Top-Level Pages';
}

Expand Down Expand Up @@ -161,10 +161,15 @@ function add_custom_menu_separator()
}

function change_admin_post_label(){

global $submenu;
$submenu['upload.php'][5][0] = 'All Media';
$submenu['upload.php'][10][0] = 'Add New Media';
global $menu, $submenu;
$submenu['users.php'][5] = array( __( 'All users' ), 'list_users', 'users.php' );
if ( current_user_can( 'create_users' ) ) {
$submenu['users.php'][10] = array( _x( 'Add new user', 'user' ), 'create_users', 'user-new.php' );
} elseif ( is_multisite() ) {
$submenu['users.php'][10] = array( _x( 'Add new user', 'user' ), 'promote_users', 'user-new.php' );
}
$submenu['upload.php'][5][0] = 'All media';
$submenu['upload.php'][10][0] = 'Add new media';

// Add Menus as a Department Site submenu and program pages
add_menu_page('Owners', 'Owners', 'manage_categories', 'edit-tags.php?taxonomy=category', '', 'dashicons-admin-users');
Expand All @@ -173,11 +178,11 @@ function change_admin_post_label(){
add_menu_page('Tags', 'Tags', 'manage_categories', 'edit-tags.php?taxonomy=post_tag', '', 'dashicons-tag');

add_submenu_page('edit.php', 'Announcements', 'Announcements', 'edit_posts', 'edit.php?post_type=announcement');
add_submenu_page('edit.php?post_type=service_page', 'Add Service Page', 'Add Service Page', 'manage_categories', 'post-new.php?post_type=service_page');
add_submenu_page('edit.php?post_type=programs', 'Add Program Page', 'Add Program Page', 'manage_categories', 'post-new.php?post_type=programs');
add_submenu_page('edit.php?post_type=programs', 'Nav Menu', 'Navigation Menu', 'edit_posts', 'nav-menus.php');
add_submenu_page('edit.php?post_type=department_page', 'Add Department Page', 'Add Department Page', 'manage_categories', 'post-new.php?post_type=department_page');
add_submenu_page('edit.php?post_type=department_page', 'Nav Menu', 'Navigation Menu', 'edit_posts', 'nav-menus.php');
add_submenu_page('edit.php?post_type=service_page', 'Add Service Page', 'Add service page', 'manage_categories', 'post-new.php?post_type=service_page');
add_submenu_page('edit.php?post_type=programs', 'Add Program Page', 'Add program page', 'manage_categories', 'post-new.php?post_type=programs');
add_submenu_page('edit.php?post_type=programs', 'Nav Menu', 'Navigation menus', 'edit_posts', 'nav-menus.php');
add_submenu_page('edit.php?post_type=department_page', 'Add Department Page', 'Add department page', 'manage_categories', 'post-new.php?post_type=department_page');
add_submenu_page('edit.php?post_type=department_page', 'Nav Menu', 'Navigation menus', 'edit_posts', 'nav-menus.php');

remove_menu_page( 'edit.php?post_type=announcement' );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ function create_phila_service_updates() {
register_post_type( 'service_updates',
array(
'labels' => array(
'name' => __( 'Service Updates' ),
'singular_name' => __( 'Service Update' ),
'add_new' => __( 'Add Service Update' ),
'all_items' => __( 'All Service Updates' ),
'add_new_item' => __( 'Add Service Update' ),
'edit_item' => __( 'Edit Service Update' ),
'view_item' => __( 'View Service Update' ),
'search_items' => __( 'Search Service Updates'),
'not_found' => __( 'Service Update not found' ),
'not_found_in_trash' => __( 'Service Update not found in trash' ),
'name' => __( 'Service updates' ),
'singular_name' => __( 'Service update' ),
'add_new' => __( 'Add service update' ),
'all_items' => __( 'All service updates' ),
'add_new_item' => __( 'Add service update' ),
'edit_item' => __( 'Edit service update' ),
'view_item' => __( 'View service update' ),
'search_items' => __( 'Search service updates'),
'not_found' => __( 'Service update not found' ),
'not_found_in_trash' => __( 'Service update not found in trash' ),
),
'taxonomies' => array('category'),
'supports' => array(
Expand Down Expand Up @@ -183,16 +183,16 @@ function create_phila_site_wide_alert() {
register_post_type( 'site_wide_alert',
array(
'labels' => array(
'name' => __( 'Site-wide Alerts' ),
'singular_name' => __( 'Site-wide Alert' ),
'add_new' => __( 'Add Site-wide Alert' ),
'all_items' => __( 'All Site-wide Alerts' ),
'add_new_item' => __( 'Add Site-wide Alerts' ),
'edit_item' => __( 'Edit Site-wide Alerts' ),
'view_item' => __( 'View Site-wide Alerts' ),
'search_items' => __( 'Search Site-wide Alerts'),
'not_found' => __( 'Site-wide Alert not found' ),
'not_found_in_trash' => __( 'Site-wide Alert not found in trash' ),
'name' => __( 'Site-wide alerts' ),
'singular_name' => __( 'Site-wide alert' ),
'add_new' => __( 'Add site-wide alert' ),
'all_items' => __( 'All site-wide alerts' ),
'add_new_item' => __( 'Add site-wide alert' ),
'edit_item' => __( 'Edit site-wide alerts' ),
'view_item' => __( 'View site-wide alerts' ),
'search_items' => __( 'Search site-wide alerts'),
'not_found' => __( 'Site-wide alert not found' ),
'not_found_in_trash' => __( 'Site-wide alert not found in trash' ),
),
'exclude_from_search' => true,
'show_in_rest' => true,
Expand All @@ -215,16 +215,16 @@ function create_phila_document() {
register_post_type( 'document',
array(
'labels' => array(
'name' => __( 'Document Page' ),
'singular_name' => __( 'Document Page' ),
'add_new' => __( 'Add Document Page' ),
'all_items' => __( 'All Document Pages' ),
'add_new_item' => __( 'Add New Document Page' ),
'edit_item' => __( 'Edit Document Page' ),
'view_item' => __( 'View Document Page' ),
'search_items' => __( 'Search Document Pages' ),
'not_found' => __( 'Document Page Not Found' ),
'not_found_in_trash' => __( 'Document Page not found in trash' ),
'name' => __( 'Document pages' ),
'singular_name' => __( 'Document page' ),
'add_new' => __( 'Add document page' ),
'all_items' => __( 'All document pages' ),
'add_new_item' => __( 'Add document page' ),
'edit_item' => __( 'Edit document page' ),
'view_item' => __( 'View document page' ),
'search_items' => __( 'Search document pages' ),
'not_found' => __( 'Document page Not Found' ),
'not_found_in_trash' => __( 'Document page not found in trash' ),
),
'taxonomies' => array(
'category',
Expand Down Expand Up @@ -331,16 +331,16 @@ function create_phila_staff_directory() {
register_post_type( 'staff_directory',
array(
'labels' => array(
'name' => __( 'Staff Members' ),
'singular_name' => __( 'Staff Member' ),
'add_new' => __( 'Add Staff Member' ),
'all_items' => __( 'All Staff Members' ),
'add_new_item' => __( 'Add Staff Member' ),
'edit_item' => __( 'Edit Staff Members' ),
'view_item' => __( 'View Staff Members' ),
'search_items' => __( 'Search Staff Members'),
'not_found' => __( 'Staff Member not found' ),
'not_found_in_trash' => __( 'Staff Member entry not found in trash' ),
'name' => __( 'Staff members' ),
'singular_name' => __( 'Staff member' ),
'add_new' => __( 'Add staff member' ),
'all_items' => __( 'All staff' ),
'add_new_item' => __( 'Add staff member' ),
'edit_item' => __( 'Edit staff members' ),
'view_item' => __( 'View staff members' ),
'search_items' => __( 'Search staff members'),
'not_found' => __( 'Staff member not found' ),
'not_found_in_trash' => __( 'Staff member entry not found in trash' ),
),
'taxonomies' => array('category'),
'supports' => array(
Expand All @@ -367,16 +367,16 @@ function create_phila_longform_content() {
register_post_type( 'longform_content',
array(
'labels' => array(
'name' => __( 'Longform Page' ),
'singular_name' => __( 'Longform Page' ),
'add_new' => __( 'Add Longform Page' ),
'all_items' => __( 'All Longform Pages' ),
'add_new_item' => __( 'Add New Longform Page' ),
'edit_item' => __( 'Edit Longform Page' ),
'view_item' => __( 'View Longform Page' ),
'search_items' => __( 'Search Longform Pages' ),
'not_found' => __( 'Longform Page Not Found' ),
'not_found_in_trash' => __( 'Longform Page not found in trash' ),
'name' => __( 'Long-form page' ),
'singular_name' => __( 'Long-form page' ),
'add_new' => __( 'Add long-form page' ),
'all_items' => __( 'All long-form pages' ),
'add_new_item' => __( 'Add longform page' ),
'edit_item' => __( 'Edit longform page' ),
'view_item' => __( 'View longform page' ),
'search_items' => __( 'Search longform pages' ),
'not_found' => __( 'Longform page Not Found' ),
'not_found_in_trash' => __( 'Longform page not found in trash' ),
),
'taxonomies' => array(
'category',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ function audiences() {
'labels' => array(
'name' => _x( 'Audiences', 'phila-gov'),
'singular_name' => _x( 'Audience', 'phila-gov' ),
'search_items' => __( 'Search Audiences' ),
'all_items' => __( 'All Audiences' ),
'edit_item' => __( 'Edit Audience' ),
'update_item' => __( 'Update Audience' ),
'add_new_item' => __( 'Add New Audience' ),
'new_item_name' => __( 'New Audience' ),
'search_items' => __( 'Search audiences' ),
'all_items' => __( 'All audiences' ),
'edit_item' => __( 'Edit audience' ),
'update_item' => __( 'Update audience' ),
'add_new_item' => __( 'Add New audience' ),
'new_item_name' => __( 'New audience' ),
'menu_name' => __( 'Audiences' ),
),
'public' => true,
Expand All @@ -93,15 +93,15 @@ function media_type() {
array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Media Type', 'phila-gov'),
'singular_name' => _x( 'Media Type', 'phila-gov'),
'search_items' => __( 'Search Media Types' ),
'all_items' => __( 'All Media Types' ),
'edit_item' => __( 'Edit Media Type' ),
'update_item' => __( 'Update Media Type' ),
'add_new_item' => __( 'Add New Media Type' ),
'new_item_name' => __( 'New Media Type Name' ),
'menu_name' => __( 'Media Types' ),
'name' => _x( 'Media type', 'phila-gov'),
'singular_name' => _x( 'Media type', 'phila-gov'),
'search_items' => __( 'Search media types' ),
'all_items' => __( 'All media types' ),
'edit_item' => __( 'Edit media type' ),
'update_item' => __( 'Update media type' ),
'add_new_item' => __( 'Add New media type' ),
'new_item_name' => __( 'New media type Name' ),
'menu_name' => __( 'Media types' ),
),
'public' => true,
'show_admin_column' => true,
Expand All @@ -120,15 +120,15 @@ function media_author() {
array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Media Author', 'phila-gov'),
'singular_name' => _x( 'Media Author', 'phila-gov'),
'search_items' => __( 'Search Media Author' ),
'all_items' => __( 'All Media Authors' ),
'edit_item' => __( 'Edit Media Author' ),
'update_item' => __( 'Update Media Author' ),
'add_new_item' => __( 'Add New Media Author' ),
'new_item_name' => __( 'New Media Author Name' ),
'menu_name' => __( 'Media Author' ),
'name' => _x( 'Media author', 'phila-gov'),
'singular_name' => _x( 'Media author', 'phila-gov'),
'search_items' => __( 'Search media author' ),
'all_items' => __( 'All media authors' ),
'edit_item' => __( 'Edit media author' ),
'update_item' => __( 'Update media author' ),
'add_new_item' => __( 'Add New media author' ),
'new_item_name' => __( 'New media author Name' ),
'menu_name' => __( 'Media author' ),
),
'public' => true,
'show_admin_column' => true,
Expand All @@ -147,15 +147,15 @@ function media_category() {
array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Media Category', 'phila-gov'),
'singular_name' => _x( 'Media Category', 'phila-gov'),
'search_items' => __( 'Search Media Categories' ),
'all_items' => __( 'All Media Categories' ),
'edit_item' => __( 'Edit Media Category' ),
'update_item' => __( 'Update Media Category' ),
'add_new_item' => __( 'Add New Media Category' ),
'new_item_name' => __( 'New Media Category Name' ),
'menu_name' => __( 'Media Categories' ),
'name' => _x( 'Media category', 'phila-gov'),
'singular_name' => _x( 'Media category', 'phila-gov'),
'search_items' => __( 'Search media categories' ),
'all_items' => __( 'All media categories' ),
'edit_item' => __( 'Edit media category' ),
'update_item' => __( 'Update media category' ),
'add_new_item' => __( 'Add New media category' ),
'new_item_name' => __( 'New media category Name' ),
'menu_name' => __( 'Media categories' ),
),
'public' => true,
'show_admin_column' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ function create_phila_department_pages() {
array(
'labels' => array(
'name' => __( 'Department page' ),
'menu_name' => __('Department Pages'),
'menu_name' => __('Department pages'),
'singular_name' => __( 'Department page' ),
'add_new' => __( 'Add a Page' ),
'all_items' => __( 'All Department Pages' ),
'add_new_item' => __( 'Add a Department Page' ),
'edit_item' => __( 'Edit Department Page' ),
'view_item' => __( 'View Department Page' ),
'search_items' => __( 'Search Department Pages' ),
'not_found' => __( 'No Pages Found' ),
'not_found_in_trash' => __( 'Department Page not found in trash' ),
'add_new' => __( 'Add a page' ),
'all_items' => __( 'All department pages' ),
'add_new_item' => __( 'Add department page' ),
'edit_item' => __( 'Edit department page' ),
'view_item' => __( 'View department page' ),
'search_items' => __( 'Search department pages' ),
'not_found' => __( 'No pages found' ),
'not_found_in_trash' => __( 'Department page not found in trash' ),
),
'taxonomies' => array('category'),
'supports' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ function create_phila_event_spotlight() {
register_post_type( 'event_spotlight',
array(
'labels' => array(
'name' => __( 'Event Spotlight page' ),
'menu_name' => __('Event Spotlight'),
'singular_name' => __( 'Event Spotlight page' ),
'add_new' => __( 'Add Spotlight Page' ),
'all_items' => __( 'All Spotlights' ),
'add_new_item' => __( 'Add a Event Spotlight Page' ),
'edit_item' => __( 'Edit Event Spotlight Page' ),
'view_item' => __( 'View Event Spotlight Page' ),
'search_items' => __( 'Search Event Spotlight Pages' ),
'not_found' => __( 'No Pages Found' ),
'not_found_in_trash' => __( 'Event Spotlight Page not found in trash' ),
'name' => __( 'Event spotlight page' ),
'menu_name' => __('Event spotlight'),
'singular_name' => __( 'Event spotlight page' ),
'add_new' => __( 'Add spotlight page' ),
'all_items' => __( 'All spotlights' ),
'add_new_item' => __( 'Add spotlight page' ),
'edit_item' => __( 'Edit event spotlight page' ),
'view_item' => __( 'View event spotlight page' ),
'search_items' => __( 'Search event spotlight pages' ),
'not_found' => __( 'No pages Found' ),
'not_found_in_trash' => __( 'Event spotlight page not found in trash' ),
),
'taxonomies' => array('category'),
'supports' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function create_phila_guides() {
'name' => __( 'Guides' ),
'menu_name' => __('Guides '),
'singular_name' => __( 'Guide' ),
'add_new' => __( 'Add Guide page' ),
'add_new' => __( 'Add guide page' ),
'all_items' => __( 'All guides' ),
'add_new_item' => __( 'Add a Page' ),
'edit_item' => __( 'Edit a Page' ),
Expand Down
Loading

0 comments on commit 1f905fb

Please sign in to comment.