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: update custom endpoints to utilize server-side pagination #1942

Open
wants to merge 201 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
33f127e
extend post rest api
derrickdso Apr 27, 2023
c98efdb
in progress
derrickdso May 3, 2023
82ea8d5
get featured media and tags
derrickdso May 8, 2023
2f0f168
add check for null images
May 10, 2023
88e53af
announcements endpoint
derrickdso May 17, 2023
bf51096
announcements and spotlights
derrickdso May 17, 2023
72d1e15
announcements and spotlights 2
derrickdso May 17, 2023
f1d1b80
starting sitewide alerts
derrickdso Jul 7, 2023
a5d9a13
temp
derrickdso Jul 14, 2023
1350172
working endpoint
derrickdso Jul 17, 2023
d4238d1
remove extra code and import vue site wide alerts
derrickdso Jul 18, 2023
debe749
Merge pull request #1938 from CityOfPhiladelphia/quarter-page-fix
m-atia Jul 19, 2023
9884508
Merge pull request #1899 from CityOfPhiladelphia/blog-endpoints
m-atia Jul 19, 2023
8e86909
Merge pull request #1939 from CityOfPhiladelphia/ppr-fix
m-atia Jul 19, 2023
fbab878
Merge pull request #1941 from CityOfPhiladelphia/ppr-fix
m-atia Jul 19, 2023
edfe038
add filtering by template for posts endpoint
m-atia Jul 20, 2023
e438d60
Merge pull request #1944 from CityOfPhiladelphia/blog-endpoints
m-atia Jul 20, 2023
19c2bfa
Merge branch 'staging' into sitewide-alerts-vue
derrickdso Jul 20, 2023
fbc0812
Merge pull request #1946 from CityOfPhiladelphia/main
derrickdso Jul 24, 2023
fb972ea
Merge pull request #1945 from CityOfPhiladelphia/sitewide-alerts-vue
derrickdso Jul 24, 2023
93fdc4a
env for site wide alerts
derrickdso Jul 24, 2023
f4adbb7
Merge pull request #1947 from CityOfPhiladelphia/sitewide-alerts-vue
derrickdso Jul 24, 2023
f7d2a08
Merge pull request #1943 from CityOfPhiladelphia/arabic-bug-fixes
m-atia Jul 25, 2023
c126066
Merge pull request #1948 from CityOfPhiladelphia/arabic-bug-fixes
m-atia Jul 25, 2023
60d8886
move site wide banners to alerts vue app
derrickdso Jul 25, 2023
f1f677d
Merge pull request #1949 from CityOfPhiladelphia/sitewide-alerts-vue
derrickdso Jul 25, 2023
a603239
update custom post type to filter in sequence
m-atia Jul 25, 2023
3f37eb7
Merge pull request #1950 from CityOfPhiladelphia/blog-endpoints
m-atia Jul 25, 2023
027e299
fix filtering functions meta queries
m-atia Jul 25, 2023
1f8e465
Merge pull request #1951 from CityOfPhiladelphia/blog-endpoints
m-atia Jul 25, 2023
26d72d8
undo custom filter function which is unecessary since the meta query …
m-atia Jul 25, 2023
3e00378
Merge pull request #1952 from CityOfPhiladelphia/blog-endpoints
m-atia Jul 25, 2023
d8c38e2
no button
derrickdso Jul 25, 2023
1fb2a1f
Merge pull request #1953 from CityOfPhiladelphia/sitewide-alerts-vue
derrickdso Jul 25, 2023
6df0ee5
Merge pull request #1955 from CityOfPhiladelphia/translation-fixes-07…
derrickdso Jul 28, 2023
f4d464e
Merge pull request #1957 from CityOfPhiladelphia/translation-fixes-07…
derrickdso Jul 28, 2023
b97bdb6
empty commit
derrickdso Jul 28, 2023
b4f4e48
Merge pull request #1960 from CityOfPhiladelphia/translation-fixes-07…
derrickdso Jul 28, 2023
3dc6c69
member list component
Aug 4, 2023
0331b7e
Merge branch 'staging' into main-to-staging-08-07-23
derrickdso Aug 7, 2023
4b7cddb
Merge pull request #1965 from CityOfPhiladelphia/main-to-staging-08-0…
derrickdso Aug 7, 2023
fa3db04
Merge pull request #1966 from CityOfPhiladelphia/add-langs-header-dro…
IshKeyes Aug 14, 2023
32cf694
file removed
Aug 15, 2023
67dd33b
Merge pull request #1968 from CityOfPhiladelphia/removal-of-duplicate…
IshKeyes Aug 15, 2023
74552b6
file updated to member_list
Aug 23, 2023
dd1701b
update object name to members
Aug 23, 2023
3beb4f5
table title field removed
Aug 23, 2023
95b8366
section title added
Aug 23, 2023
e9d9c08
Merge pull request #1970 from CityOfPhiladelphia/refactor-content-pro…
RitikaDesai98 Aug 24, 2023
ff869a1
Merge pull request #1972 from CityOfPhiladelphia/main
RitikaDesai98 Aug 24, 2023
1936bd0
Merge pull request #1969 from CityOfPhiladelphia/trash-recylcing-upda…
IshKeyes Aug 25, 2023
afd417b
add template admin fields
derrickdso Nov 16, 2022
101556f
add FE template file
derrickdso Nov 16, 2022
5c38b28
advanced post roles
derrickdso Nov 22, 2022
7f98755
post grid in progress
derrickdso Nov 30, 2022
d6f6493
Merge pull request #1971 from CityOfPhiladelphia/update-phila-modal-desc
IshKeyes Aug 30, 2023
a641cdf
Merge branch 'staging' into program-pages-staff-members-component
Aug 30, 2023
3c08427
Merge pull request #1963 from CityOfPhiladelphia/program-pages-staff-…
IshKeyes Aug 30, 2023
cac1789
Merge branch 'refactor-content-program-initiatives' into staging
RitikaDesai98 Aug 31, 2023
531ed1f
Merge pull request #1978 from CityOfPhiladelphia/refactor-to-staging
RitikaDesai98 Aug 31, 2023
3b66228
Merge pull request #1973 from CityOfPhiladelphia/fix-filter-tag
RitikaDesai98 Aug 31, 2023
71f787a
Merge pull request #1981 from CityOfPhiladelphia/main
derrickdso Sep 5, 2023
c2298aa
fixed programs + initiatives to programs
RitikaDesai98 Sep 7, 2023
ad454d2
Merge pull request #1982 from CityOfPhiladelphia/reorganize-wp-dashbo…
RitikaDesai98 Sep 7, 2023
a92d23e
Merge pull request #1984 from CityOfPhiladelphia/main
derrickdso Sep 11, 2023
bac3c30
created a lists component for adv blog posts
RitikaDesai98 Sep 13, 2023
08e32f2
added q&a component to adv blog posts
RitikaDesai98 Sep 14, 2023
57f2009
added timeline component in adv blog posts and refactored homepage_ti…
RitikaDesai98 Sep 15, 2023
22968a1
Merge pull request #1987 from CityOfPhiladelphia/update-wordpress-202…
IshKeyes Sep 15, 2023
7122cb6
added stepped process to adv blog posts
RitikaDesai98 Sep 15, 2023
8aade22
Merge pull request #1990 from CityOfPhiladelphia/enable-hidden-langua…
IshKeyes Sep 18, 2023
0e2e763
Merge pull request #1983 from CityOfPhiladelphia/create-error-message
RitikaDesai98 Sep 20, 2023
72e45ef
merge with main
RitikaDesai98 Sep 20, 2023
7a5531c
Merge pull request #1997 from CityOfPhiladelphia/main
RitikaDesai98 Sep 22, 2023
c73bedf
Merge pull request #1998 from CityOfPhiladelphia/fix-section-tags
RitikaDesai98 Sep 22, 2023
7867d0c
Merge pull request #2001 from CityOfPhiladelphia/hompage-member-list-…
IshKeyes Sep 27, 2023
cf43d6b
language dropdown error fixed
Sep 27, 2023
df5b7fe
indentation fixed
Sep 27, 2023
c344edd
Merge branch 'staging' into language-dropdown-fix2
IshKeyes Sep 27, 2023
971d9eb
Merge pull request #2003 from CityOfPhiladelphia/language-dropdown-fix2
IshKeyes Sep 27, 2023
68e6c80
Merge pull request #2000 from CityOfPhiladelphia/fix-overlap-news-search
RitikaDesai98 Sep 28, 2023
ca9f4bb
Merge pull request #2006 from CityOfPhiladelphia/main
derrickdso Oct 2, 2023
0966019
Merge pull request #2005 from CityOfPhiladelphia/cache-npm
derrickdso Oct 4, 2023
8d22034
Merge pull request #2010 from CityOfPhiladelphia/fixed_section_div_tags
RitikaDesai98 Oct 5, 2023
d695e1f
Merge pull request #2014 from CityOfPhiladelphia/main
derrickdso Oct 16, 2023
caf0803
extend local storage to other langs
derrickdso Oct 16, 2023
dddc797
Merge pull request #2015 from CityOfPhiladelphia/local-storage-langs
derrickdso Oct 17, 2023
f167c49
updated changes
RitikaDesai98 Oct 18, 2023
3c41a2a
moved custom css from functions to admin.css
RitikaDesai98 Oct 18, 2023
4ee67d2
Merge pull request #2017 from CityOfPhiladelphia/reorganize-wp-dashbo…
RitikaDesai98 Oct 18, 2023
eb7b4a7
added image gallery to adv blog posts
RitikaDesai98 Oct 24, 2023
8d69e47
Merge pull request #2019 from CityOfPhiladelphia/update-plugins-2023-…
IshKeyes Oct 24, 2023
fdad381
fixed the post picker to pick posts/advanced posts according to selec…
RitikaDesai98 Oct 24, 2023
dd84d00
Merge pull request #2020 from CityOfPhiladelphia/fixed_post_picker
RitikaDesai98 Oct 24, 2023
12a6d6f
Merge pull request #2022 from CityOfPhiladelphia/update-voting-links-…
IshKeyes Oct 25, 2023
b49b53d
Merge pull request #2026 from CityOfPhiladelphia/main
derrickdso Oct 30, 2023
c67298b
made changes to lightbox and added tab nav
RitikaDesai98 Oct 30, 2023
9832965
Merge pull request #2027 from CityOfPhiladelphia/fix-img-tags
RitikaDesai98 Oct 31, 2023
1ffd038
code clean up
RitikaDesai98 Oct 31, 2023
78c10e6
frontend changes
RitikaDesai98 Nov 1, 2023
5782626
Merge pull request #2021 from CityOfPhiladelphia/service-menu-endpoint
m-atia Nov 2, 2023
9960b4d
wysiwyg added
Nov 3, 2023
8a476b1
wysiwyg added2
Nov 3, 2023
7541f3a
added series component to adv blog posts
RitikaDesai98 Nov 8, 2023
669e609
Merge pull request #2032 from CityOfPhiladelphia/mobile-menu-staging
m-atia Nov 9, 2023
af66f08
Merge pull request #2036 from CityOfPhiladelphia/fix-search-field
m-atia Nov 10, 2023
f566e6d
topic page wysiwyg fix1
Nov 10, 2023
2eb5258
topic page wysiwyg fix2
Nov 10, 2023
6482932
Merge pull request #2038 from CityOfPhiladelphia/main
derrickdso Nov 13, 2023
89805ad
Merge pull request #2039 from CityOfPhiladelphia/update-global-nav
m-atia Nov 13, 2023
de76a69
Merge pull request #2030 from CityOfPhiladelphia/add-wysiwig-topic-page
IshKeyes Nov 15, 2023
cd0d402
Merge pull request #2033 from CityOfPhiladelphia/resource-group-icons…
IshKeyes Nov 20, 2023
dcce361
Merge pull request #2043 from CityOfPhiladelphia/main
derrickdso Nov 27, 2023
8af3dbc
Merge pull request #2044 from CityOfPhiladelphia/fix-blog-langs
m-atia Nov 29, 2023
c2cb7a9
Merge pull request #2045 from CityOfPhiladelphia/fix-blog-langs
m-atia Nov 29, 2023
564b4f1
Merge pull request #2049 from CityOfPhiladelphia/main
derrickdso Dec 11, 2023
8eb6b3f
update conditional to render short description
Dec 11, 2023
cdfea8f
metabox update
Dec 11, 2023
e702e93
Merge pull request #2047 from CityOfPhiladelphia/translating-staff-name
IshKeyes Dec 11, 2023
af2de1b
Merge pull request #2051 from CityOfPhiladelphia/date-for-last-update…
IshKeyes Dec 13, 2023
f7b9eaf
changed menu item highlighting & added sentence case
RitikaDesai98 Dec 13, 2023
867a028
Merge branch 'staging' into add-wysiwyg-topic-page-2
IshKeyes Dec 14, 2023
a12703e
Merge pull request #2050 from CityOfPhiladelphia/add-wysiwyg-topic-pa…
IshKeyes Dec 14, 2023
10b631e
changed labels for calendar and text blocks
RitikaDesai98 Dec 15, 2023
dd7b00a
Merge pull request #2048 from CityOfPhiladelphia/longform-footer-fix
RitikaDesai98 Dec 15, 2023
1f905fb
Merge pull request #2052 from CityOfPhiladelphia/reorganize-wp-dashbo…
RitikaDesai98 Dec 15, 2023
fbab20d
Merge pull request #2056 from CityOfPhiladelphia/longform-footer-fix
RitikaDesai98 Dec 21, 2023
e15620e
Merge pull request #2055 from CityOfPhiladelphia/translating-staff-name
IshKeyes Dec 21, 2023
95c5139
Merge pull request #2058 from CityOfPhiladelphia/fix-commissioner-member
m-atia Dec 28, 2023
5ac7f23
Merge pull request #2060 from CityOfPhiladelphia/main
derrickdso Jan 3, 2024
1f25b3a
added post to series relationship
RitikaDesai98 Jan 3, 2024
03a90aa
Merge branch 'main' into blog_posts
RitikaDesai98 Jan 3, 2024
ff00bf6
Merge pull request #2062 from CityOfPhiladelphia/longform-footer-fix
RitikaDesai98 Jan 3, 2024
96e10cf
Merge pull request #2063 from CityOfPhiladelphia/restrict-media-types
m-atia Jan 3, 2024
b2ac452
Merge pull request #2061 from CityOfPhiladelphia/update-fontawesome-6…
m-atia Jan 4, 2024
33cbe1b
changed labels to sentence case
RitikaDesai98 Jan 8, 2024
15f05ce
Merge pull request #2067 from CityOfPhiladelphia/reorganize-wp-dashbo…
RitikaDesai98 Jan 8, 2024
102b29d
Merge branch 'blog-endpoints' into main-merge-1-10
m-atia Jan 10, 2024
7329442
Merge pull request #2071 from CityOfPhiladelphia/main-merge-1-10
m-atia Jan 10, 2024
f7924bd
added cpt blog_post
RitikaDesai98 Jan 11, 2024
f6fa7c3
Merge branch 'blog-endpoints' into blog_posts
m-atia Jan 11, 2024
7189b09
Merge pull request #2073 from CityOfPhiladelphia/blog_posts
m-atia Jan 11, 2024
7a55677
span tag added
Jan 22, 2024
8d0cd6b
Merge pull request #2076 from CityOfPhiladelphia/linked-text-question…
IshKeyes Jan 22, 2024
5cd151e
testing archive
m-atia Jan 22, 2024
66486c4
testing archive
m-atia Jan 22, 2024
ffd1b05
Merge pull request #2077 from CityOfPhiladelphia/test-hide-empty-tables
m-atia Jan 22, 2024
ca0b630
move mb-revision
derrickdso Jan 26, 2024
161bafa
Merge pull request #2080 from CityOfPhiladelphia/fix-update-mb-revision
derrickdso Jan 26, 2024
b24f766
edit menu requirements for submenus
m-atia Jan 30, 2024
7ba1752
Merge pull request #2082 from CityOfPhiladelphia/reorganize-wp-dashbo…
m-atia Jan 30, 2024
42e3f32
Merge pull request #2083 from CityOfPhiladelphia/allow-media-types
m-atia Jan 31, 2024
6c5263d
Merge pull request #2085 from CityOfPhiladelphia/anchor-link-fix
m-atia Feb 1, 2024
e9251a5
Merge pull request #2087 from CityOfPhiladelphia/anchor-link-fix
m-atia Feb 1, 2024
1310f10
Merge pull request #2079 from CityOfPhiladelphia/required-fields-for-…
IshKeyes Feb 2, 2024
b71b5e4
testing user role menu addition
m-atia Feb 2, 2024
fbfb545
Merge pull request #2088 from CityOfPhiladelphia/reorganize-wp-dashbo…
m-atia Feb 2, 2024
cbb73ed
Merge pull request #2066 from CityOfPhiladelphia/program-tiles-width-fix
IshKeyes Feb 5, 2024
15aad2a
Merge pull request #2075 from CityOfPhiladelphia/collection-page-head…
IshKeyes Feb 8, 2024
9036182
Merge pull request #2092 from CityOfPhiladelphia/anchor-link-fix
m-atia Feb 8, 2024
6efd262
Merge pull request #2091 from CityOfPhiladelphia/language-selector
RitikaDesai98 Feb 8, 2024
2e2f367
Merge pull request #2095 from CityOfPhiladelphia/remove-hr-tag-from-r…
IshKeyes Feb 12, 2024
8fe47c4
Merge pull request #2068 from CityOfPhiladelphia/related-content-visu…
RitikaDesai98 Feb 14, 2024
3bd0cd9
testing user roles menus
m-atia Feb 26, 2024
c418bd4
Merge pull request #2099 from CityOfPhiladelphia/reorganize-wp-dashbo…
m-atia Feb 26, 2024
4704631
Merge pull request #2100 from CityOfPhiladelphia/change-twitter-logo
RitikaDesai98 Feb 27, 2024
c6143cc
Clarify archival needs
karissademi Feb 27, 2024
d2655c6
update staff labels for content team
m-atia Feb 28, 2024
bf99b96
Merge branch 'staging' into update-staff-input-labels
m-atia Feb 28, 2024
595cf56
make job title required
m-atia Feb 28, 2024
88b563f
content fix
m-atia Feb 28, 2024
1985523
Merge pull request #2096 from CityOfPhiladelphia/add-cost-component
RitikaDesai98 Mar 5, 2024
68aec1d
remove optional tags
m-atia Mar 7, 2024
83004a3
Merge pull request #2101 from CityOfPhiladelphia/update-staff-input-l…
m-atia Mar 7, 2024
04fff1b
FE changes
RitikaDesai98 Mar 14, 2024
6f2a163
Adjustments for non-archived posts
karissademi Mar 22, 2024
e81fcdf
Remove test code
karissademi Mar 22, 2024
23dc4e6
Remove date query
karissademi Mar 26, 2024
082ef2a
Merge pull request #2106 from CityOfPhiladelphia/fix/role-plugin
karissademi Apr 2, 2024
36e1f00
Merge pull request #2105 from CityOfPhiladelphia/remove-forms-template
m-atia Apr 3, 2024
094db87
Merge pull request #2110 from CityOfPhiladelphia/use-solid-icons
m-atia Apr 4, 2024
ad60340
Merge pull request #2107 from CityOfPhiladelphia/sitewide-alerts
RitikaDesai98 Apr 4, 2024
be151e1
Merge pull request #2112 from CityOfPhiladelphia/search-titles-fix
m-atia Apr 9, 2024
98c197b
Merge pull request #2115 from CityOfPhiladelphia/accessibility-fixes
m-atia Apr 10, 2024
d909aee
Merge pull request #2114 from CityOfPhiladelphia/add-cost-component
RitikaDesai98 Apr 10, 2024
6c81199
Merge pull request #2117 from CityOfPhiladelphia/add-cost-component
RitikaDesai98 Apr 10, 2024
b74896a
update feedback form to use v4 formstack form
m-atia Apr 16, 2024
aa83d31
Merge pull request #2120 from CityOfPhiladelphia/update-forms
m-atia Apr 16, 2024
15a96db
Merge pull request #2121 from CityOfPhiladelphia/fix/multi-department
m-atia Apr 22, 2024
9828881
fixed site-wide alerts rendering with end date in past
RitikaDesai98 Apr 25, 2024
349dee8
Merge pull request #2124 from CityOfPhiladelphia/sitewide-alerts
RitikaDesai98 Apr 25, 2024
ee75a8c
updated wpfront user role plugin
RitikaDesai98 Apr 26, 2024
de17988
Merge branch 'staging' into update-plugin-2024-04-25
m-atia Apr 26, 2024
8658e53
Merge pull request #2125 from CityOfPhiladelphia/update-plugin-2024-0…
RitikaDesai98 Apr 26, 2024
2ff4b29
feedback changes
RitikaDesai98 May 9, 2024
8f4354c
Merge branch 'staging' into blog_posts
RitikaDesai98 May 22, 2024
f04253f
update the latest endpoint to return tags
m-atia Jun 6, 2024
2dd313a
delete vestigal code
m-atia Jun 6, 2024
6dbebcc
scrolltop
m-atia Jun 14, 2024
d0dea33
Merge pull request #2130 from CityOfPhiladelphia/blog_posts
m-atia Jun 14, 2024
502e662
Merge branch 'main' into blog-endpoints
m-atia Jun 14, 2024
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
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/private-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source /home/ubuntu/.ssh/environment
# wps-hide-login.1.5.7.zip <- hide login plugin

_dir="$(dirname "$0")"
plugins="wpfront-user-role-editor-personal-pro-2.14.5.zip"
plugins="wpfront-user-role-editor-personal-pro-4.1.0.zip"

cd /home/ubuntu/app
for plugin in $plugins; do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ function phila_resource_hub_page()
function phila_resource_hub_content()
{
?>
<style>
ul{
list-style: disc;
margin-left: 2em;
}
</style>
<h1 id="resource-hub">Resource hub</h1>
<p>The following resources may be useful as you create and manage content on phila.gov. </p>
<h2 id="resources-for-site-editors">Resources for site editors</h2>
Expand All @@ -24,7 +18,7 @@ function phila_resource_hub_content()
<hr>
<p><a href="https://phila.sharepoint.com/:f:/s/Teams-OIT-PhilagovProjectTeam/EuFE222ofUBNi_XknL-R6WcBGAwpdXhlikRBTyZAXiEzKQ?e=vsRAtu">Training presentations, guidance, and tip sheets</a> </p>
<p>This is a collection of training presentations and other guidance produced by the Digital Services team. It also includes: </p>
<ul>
<ul class="resource-hub">
<li><p>Documentation for various WordPress features. </p>
</li>
<li><p>Links to City stock photos and other imagery sources for blogs. </p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* Custom Post type for Blog Posts
*
*/
if ( class_exists( "Phila_Gov_Blog_Posts" ) ){
$cpt_blog_posts = new Phila_Gov_Blog_Posts();
}


class Phila_Gov_Blog_Posts{

public function __construct(){

add_action( 'init', array( $this, 'create_phila_blog_posts' ), 1 );

}

function create_phila_blog_posts() {
register_post_type( 'blog_post',
array(
'labels' => array(
'name' => __( 'Blog posts' ),
'menu_name' => __('Blog posts'),
'singular_name' => __( 'Blog post' ),
'add_new' => __( 'Add a post' ),
'all_items' => __( 'All posts' ),
'add_new_item' => __( 'Add a blog post' ),
'edit_item' => __( 'Edit blog post' ),
'view_item' => __( 'View blog post' ),
'search_items' => __( 'Search blog post' ),
'not_found' => __( 'No Pages Found' ),
'not_found_in_trash' => __( 'Blog post not found in trash' ),
),
'taxonomies' => array(
'category',
'post_tag'
),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'show_in_menu' => true,
'rest_base' => 'news',
'menu_icon' => 'dashicons-media-document',
'hierarchical' => false,
'supports' => array(
'title',
'editor',
'thumbnail',
'revisions'
),
'rewrite' => array(
'slug' => 'posts',
'with_front' => false,
),
)
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ public function __construct(){

add_action( 'init', array($this, 'phila_change_post_label') );

add_action( 'init', array($this, 'phila_change_page_label') );

add_action('admin_menu', array( $this, 'phila_hide_create_in_menu' ) );

add_action( 'pre_get_posts', array( $this, 'phila_filter_menu_search_results'), 10, 2 );

add_action('admin_menu', array($this, 'add_custom_menu_separator') );


}
Expand All @@ -40,55 +44,171 @@ function admin_menu_order( $menu_ord ) {
}
return array(
'index.php',
'resource-hub',
'separator-1',
'edit.php',
'edit.php?post_type=page',
'separator1',
'edit.php?post_type=service_page',
'edit.php?post_type=department_page',
'edit.php?post_type=programs',
'edit.php?post_type=staff_directory',
'edit.php?post_type=department_page',
'edit.php?post_type=document',
'edit.php?post_type=longform_content',
'separator2',
'separator-2',
'edit.php?post_type=event_spotlight',
'edit.php?post_type=calendar',
'edit.php?post_type=site_wide_alert',
'edit.php?post_type=guides',
'edit.php?post_type=longform_content',
'edit.php?post_type=page',
'separator-3',
'edit.php?post_type=staff_directory',
'upload.php',
'separator-last',
'edit.php?post_type=calendar',
'edit.php?post_type=text-blocks',
'edit.php?post_type=service_updates',
'edit.php?post_type=site_wide_alert',
'separator-4',
'users.php',
'wpfront-user-role-editor-all-roles',
'edit-tags.php?taxonomy=category',
'edit-tags.php?taxonomy=audience',
'edit-tags.php?taxonomy=service_type&post_type=service_page',
'edit-tags.php?taxonomy=post_tag',
'separator-5',
'themes.php',
'phila_gov',
'options-general.php',
'separator-6',
'tools.php',
'plugins.php',
);
}

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->add_new = 'Add new item to the latest';
$labels->add_new_item = 'Add new 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';
$labels->new_item = 'New item in the latest';
$labels->view_item = 'View item';
$labels->search_items = 'Search the latest';
$labels->not_found = 'Nothing found';
$labels->not_found_in_trash = 'Nothing found in trash';
$labels->all_items = 'All items';
$labels->menu_name = 'The latest';
$labels->name_admin_bar = 'The latest';
$labels->all_items = 'All news';
$labels->menu_name = 'News';
$labels->name_admin_bar = 'News';
}

function change_admin_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->add_new = 'Add top-level page';
$labels->add_new_item = 'Add top-level page';
$labels->edit_item = 'Edit top-level page';
$labels->new_item = 'New top-level page';
$labels->view_item = 'View top-level page';
$labels->search_items = 'Search top-level pages';
$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->name_admin_bar = 'Top-Level Pages';
}

// Add Menus as a Department Site submenu and program pages
add_submenu_page( 'edit.php?post_type=department_page', 'Nav Menu', 'Nav Menu', 'edit_posts', 'nav-menus.php');
function add_custom_menu_separator()
{
global $menu;
$separator_index = array(4, 59, 99);

add_submenu_page( 'edit.php?post_type=programs', 'Nav Menu', 'Nav Menu', 'edit_posts', 'nav-menus.php');
foreach($separator_index as $sp) {

if (isset($menu[$sp])) {
unset($menu[$sp]);
}
}

$user = wp_get_current_user();
$allowed_roles1 = array('primary_department_editor');
$allowed_roles2 = array('secondary_philagov_settings_editor', 'secondary_philagov_closure_settings_editor', 'secondary_tag_editor');
$allowed_roles3 = array('secondary_department_blog_editor', 'secondary_blog_contributor', 'secondary_service_page_editor', 'secondary_department_page_contributror', 'secondary_department_page_editor', 'secondary_document_page_contributor', 'secondary_document_editor', 'secondary_press_release_contributor', 'secondary_press_release_editor', 'secondary_programs__initiatives_contributor', 'secondary_programs__initiatives_editor', 'secondary_service_page_editor', 'secondary_service_status_contributor', 'secondary_staff_member_editor');
$allowed_roles4 = array('primary_department_contributor');
if (array_intersect($user->roles, $allowed_roles1) && array_intersect($user->roles, $allowed_roles2)) {
$menu[997] = ['', 'read', 'separator-1', '', 'wp-menu-separator'];
$menu[998] = ['', 'read', 'separator-4', '', 'wp-menu-separator'];
$menu[999] = ['', 'read', 'separator-6', '', 'wp-menu-separator'];
} elseif (array_intersect($user->roles, $allowed_roles1) && array_intersect($user->roles, $allowed_roles3)) {
$menu[997] = ['', 'read', 'separator-1', '', 'wp-menu-separator'];
$menu[998] = ['', 'read', 'separator-2', '', 'wp-menu-separator'];
$menu[999] = ['', 'read', 'separator-4', '', 'wp-menu-separator'];
} elseif(array_intersect($user->roles, $allowed_roles4) && array_intersect($user->roles, $allowed_roles3)) {
$menu[996] = ['', 'read', 'separator-1', '', 'wp-menu-separator'];
$menu[997] = ['', 'read', 'separator-2', '', 'wp-menu-separator'];

} elseif(array_intersect($user->roles, $allowed_roles1)){
$menu[996] = ['', 'read', 'separator-1', '', 'wp-menu-separator'];
$menu[997] = ['', 'read', 'separator-2', '', 'wp-menu-separator'];
$menu[998] = ['', 'read', 'separator-3', '', 'wp-menu-separator'];
$menu[999] = ['', 'read', 'separator-4', '', 'wp-menu-separator'];
} else {
$menu[994] = ['', 'read', 'separator-1', '', 'wp-menu-separator'];
$menu[995] = ['', 'read', 'separator-2', '', 'wp-menu-separator'];
$menu[996] = ['', 'read', 'separator-3', '', 'wp-menu-separator'];
$menu[997] = ['', 'read', 'separator-4', '', 'wp-menu-separator'];
$menu[998] = ['', 'read', 'separator-5', '', 'wp-menu-separator'];
$menu[999] = ['', 'read', 'separator-6', '', 'wp-menu-separator'];
}
}

function change_admin_post_label(){
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');
add_menu_page('Audiences', 'Audiences', 'manage_categories','edit-tags.php?taxonomy=audience', '', 'dashicons-groups');
add_menu_page('Categories', 'Categories', 'manage_categories', 'edit-tags.php?taxonomy=service_type&post_type=service_page',);
add_menu_page('Tags', 'Tags', 'manage_categories', 'edit-tags.php?taxonomy=post_tag', '', 'dashicons-tag');

add_menu_page('edit.php?post_type=department_page', 'Add Department Page', 'Add department page', 'edit_department_pages', 'post-new.php?post_type=department_page');
// add_menu_page('edit.php?post_type=department_page', 'Add Department Page', 'Add department page', 'edit_department_pages', 'post-new.php?post_type=department_page');

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', 'publish_service_pages', 'post-new.php?post_type=service_page');
add_submenu_page('edit.php?post_type=programs', 'Add Program Page', 'Add program page', 'publish_programss', 'post-new.php?post_type=programs');
add_submenu_page('edit.php?post_type=programs', 'Nav Menu', 'Navigation menus', 'publish_programss', 'nav-menus.php');
add_submenu_page('edit.php?post_type=department_page', 'Add Department Page', 'Add department page', 'publish_department_pages', 'post-new.php?post_type=department_page');
add_submenu_page('edit.php?post_type=department_page', 'Nav Menu', 'Navigation menus', 'publish_department_pages', 'nav-menus.php');

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

add_submenu_page( 'edit.php', 'Announcements', 'Announcements', 'edit_posts', 'edit.php?post_type=announcement');
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=category');
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=post_tag');
remove_submenu_page('edit.php?post_type=service_page', 'edit-tags.php?taxonomy=category&amp;post_type=service_page');
remove_submenu_page('edit.php?post_type=service_page', 'edit-tags.php?taxonomy=audience&amp;post_type=service_page');
remove_submenu_page('edit.php?post_type=service_page', 'edit-tags.php?taxonomy=service_type&amp;post_type=service_page');
remove_submenu_page('edit.php?post_type=programs', 'edit-tags.php?taxonomy=category&amp;post_type=programs');
remove_submenu_page('edit.php?post_type=programs', 'edit-tags.php?taxonomy=audience&amp;post_type=programs');
remove_submenu_page('edit.php?post_type=programs', 'edit-tags.php?taxonomy=service_type&amp;post_type=programs');
remove_submenu_page('edit.php?post_type=department_page', 'edit-tags.php?taxonomy=category&amp;post_type=department_page');
remove_submenu_page('edit.php?post_type=document', 'edit-tags.php?taxonomy=category&amp;post_type=document');
remove_submenu_page('edit.php?post_type=event_spotlight', 'edit-tags.php?taxonomy=category&amp;post_type=event_spotlight');
remove_submenu_page('edit.php?post_type=guides', 'edit-tags.php?taxonomy=category&amp;post_type=guides');
remove_submenu_page('edit.php?post_type=longform_content', 'edit-tags.php?taxonomy=category&amp;post_type=longform_content');
remove_submenu_page('edit.php?post_type=staff_directory', 'edit-tags.php?taxonomy=category&amp;post_type=staff_directory');
remove_submenu_page('edit.php?post_type=calendar', 'edit-tags.php?taxonomy=category&amp;post_type=calendar');
remove_submenu_page('edit.php?post_type=service_updates', 'edit-tags.php?taxonomy=category&amp;post_type=service_updates');

}


function phila_register_categories_for_pages(){

register_taxonomy_for_object_type('category', 'page');
Expand Down
Loading