From 33f127ed405c98d5ce78b3aa2eacdafd2729f7ee Mon Sep 17 00:00:00 2001 From: derrickdso Date: Thu, 27 Apr 2023 13:44:16 -0400 Subject: [PATCH 001/209] extend post rest api --- .../class-phila-gov-custom-post-types.php | 36 +++++++++++++++++ .../controllers/class-phila-documents.php | 10 +---- .../public/controllers/class-phila-posts.php | 25 ++---------- .../controllers/class-phila-programs.php | 10 +---- .../controllers/class-phila-staff-members.php | 10 +---- .../themes/phila.gov-theme/functions.php | 40 ++++++++++++++++--- 6 files changed, 78 insertions(+), 53 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index 290bcf647b..43bfd23115 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -285,6 +285,42 @@ function create_phila_posts() { ), ) ); + + register_rest_field( 'post', + 'archived', + array( 'get_callback' => 'get_archive_status' ), + ); + + register_rest_field( 'post', + 'categories', + array( 'get_callback' => 'get_phila_categories' ), + ); + + register_rest_field( 'post', + 'template', + array( 'get_callback' => 'get_phila_template' ), + ); + + register_rest_field( 'post', + 'tags', + array( 'get_callback' => 'get_phila_tags' ), + ); + + function get_phila_template( $post ) { + return phila_get_selected_template($post['id'], true, true); + } + + function get_archive_status( $post ) { + return phila_get_archive_status($post['id']); + } + + function get_phila_categories ( $post ) { + return phila_get_the_category($post['id']); + } + + function get_phila_tags ( $post ) { + return get_the_tags($post['id']); + } } function create_phila_press_release() { register_post_type( 'press_release', diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-documents.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-documents.php index f1f218bbb2..0160c88dd5 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-documents.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-documents.php @@ -178,15 +178,7 @@ public function prepare_item_for_response( $post, $request ) { } if (isset( $schema['properties']['categories'] )) { - $categories = get_the_category($post->ID); - - foreach ($categories as $category){ - $trimmed_name = phila_get_owner_typography( $category ); - - $category->slang_name = html_entity_decode(trim($trimmed_name)); - } - - $post_data['categories'] = (array) $categories; + $post_data['categories'] = phila_get_the_category( $post->ID ); } return rest_ensure_response( $post_data ); diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php index ada6535402..d931147360 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php @@ -355,30 +355,11 @@ public function prepare_item_for_response( $post, $request ) { } if (isset( $schema['properties']['categories'] )) { - $categories = get_the_category($post->ID); - - foreach ($categories as $category){ - $trimmed_name = phila_get_owner_typography( $category ); - - $category->slang_name = html_entity_decode(trim($trimmed_name)); - } - - $post_data['categories'] = (array) $categories; + $post_data['categories'] = phila_get_the_category($post->ID); } if (isset( $schema['properties']['archived'] )) { - $archived = rwmb_meta('phila_archive_post', '', $post->ID); - $phila_template = rwmb_meta('phila_template_select', '', $post->ID); - $post_is_old = false; - if (date('Y-m-d', strtotime('-2 years')) > $post->post_date) { // if posts are 2 years old - $post_is_old = true; - } - if ((((empty( $archived ) || !isset($archived) || $archived == 'default') && $post_is_old) || $archived == 'archive_now') && ($phila_template == 'post' || $phila_template == '')) { - $archived = true; - } else { - $archived = false; - } - $post_data['archived'] = (bool) $archived; + $post_data['archived'] = phila_get_archive_status($post->ID); } if (isset( $schema['properties']['updated_at'] )) { @@ -568,3 +549,5 @@ function phila_register_archives_rest_routes() { } add_action( 'rest_api_init', 'phila_register_archives_rest_routes' ); + + diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-programs.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-programs.php index 8f4d9471a1..e404cabfe4 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-programs.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-programs.php @@ -327,15 +327,7 @@ public function prepare_item_for_response( $post, $request ) { } if (isset( $schema['properties']['categories'] )) { - $categories = get_the_category($post->ID); - - foreach ($categories as $category){ - $trimmed_name = phila_get_owner_typography( $category ); - - $category->slang_name = html_entity_decode(trim($trimmed_name)); - } - - $post_data['categories'] = (array) $categories; + $post_data['categories'] = phila_get_the_category( $post->ID ); } if (isset( $schema['properties']['audiences'] )) { diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-staff-members.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-staff-members.php index faba86b868..aeeec6a33f 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-staff-members.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-staff-members.php @@ -209,15 +209,7 @@ public function prepare_item_for_response( $post, $request ) { } if (isset( $schema['properties']['categories'] )) { - $categories = get_the_category($post->ID); - - foreach ($categories as $category){ - $trimmed_name = phila_get_owner_typography( $category ); - - $category->slang_name = html_entity_decode(trim($trimmed_name)); - } - - $post_data['categories'] = (array) $categories; + $post_data['categories'] = phila_get_the_category( $post->ID ); } return rest_ensure_response( $post_data ); diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index d62c90c70a..d94bc22a65 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -1253,7 +1253,7 @@ function phila_get_item_meta_desc( $bloginfo = true ){ * **/ -function phila_get_selected_template( $post_id = null, $modify_response = true ){ +function phila_get_selected_template( $post_id = null, $modify_response = true, $deprecate_featured_template = false ){ $user_selected_template = rwmb_meta( 'phila_template_select', $args = array(), $post_id ); @@ -1262,11 +1262,13 @@ function phila_get_selected_template( $post_id = null, $modify_response = true ) } if ($modify_response == true ){ //used to force "featured" template type. The user doesn't select this value from the normal template dropdpown and this can be applied to any post, press release or other item. - $old_feature = get_post_meta( $post_id, 'phila_show_on_home', true); - $new_feature = get_post_meta( $post_id, 'phila_is_feature', true ); + if (!$deprecate_featured_template) { + $old_feature = get_post_meta( $post_id, 'phila_show_on_home', true); + $new_feature = get_post_meta( $post_id, 'phila_is_feature', true ); - if ( $old_feature != 0 || $new_feature != 0 ){ - $user_selected_template = 'featured'; + if ( $old_feature != 0 || $new_feature != 0 ){ + $user_selected_template = 'featured'; + } } //clean up the data by assigning "phila_post" to "post" if(get_post_type($post_id) == 'phila_post') { @@ -1277,6 +1279,34 @@ function phila_get_selected_template( $post_id = null, $modify_response = true ) return $user_selected_template; } + +function phila_get_archive_status( $post_id ) { + $archived = rwmb_meta('phila_archive_post', '', $post_id); + $phila_template = rwmb_meta('phila_template_select', '', $post_id); + $post_is_old = false; + if (date('Y-m-d', strtotime('-2 years')) > get_the_date('Y-m-d', $post_id)) { // if posts are 2 years old + $post_is_old = true; + } + if ((((empty( $archived ) || !isset($archived) || $archived == 'default') && $post_is_old) || $archived == 'archive_now') && ($phila_template == 'post' || $phila_template == '')) { + $archived = true; + } else { + $archived = false; + } + return (bool) $archived; +} + +function phila_get_the_category( $post_id ) { + $categories = get_the_category($post_id); + + foreach ($categories as $category){ + $trimmed_name = phila_get_owner_typography( $category ); + + $category->slang_name = html_entity_decode(trim($trimmed_name)); + } + + return (array) $categories; +} + /** * Do the math to determine the correct column span for X items on a 24 column grid. * From c98efdbc82f93c54e5ad49c1de239f372b27dde2 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Wed, 3 May 2023 09:43:06 -0400 Subject: [PATCH 002/209] in progress --- .../class-phila-gov-custom-post-types.php | 35 --- .../plugins/phila.gov-customization/index.php | 4 +- .../public/controllers/class-phila-posts.php | 2 - .../controllers/v2/class-phila-posts-v2.php | 237 ++++++++++++++++++ 4 files changed, 240 insertions(+), 38 deletions(-) create mode 100644 wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index 43bfd23115..32f5f365b6 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -286,41 +286,6 @@ function create_phila_posts() { ) ); - register_rest_field( 'post', - 'archived', - array( 'get_callback' => 'get_archive_status' ), - ); - - register_rest_field( 'post', - 'categories', - array( 'get_callback' => 'get_phila_categories' ), - ); - - register_rest_field( 'post', - 'template', - array( 'get_callback' => 'get_phila_template' ), - ); - - register_rest_field( 'post', - 'tags', - array( 'get_callback' => 'get_phila_tags' ), - ); - - function get_phila_template( $post ) { - return phila_get_selected_template($post['id'], true, true); - } - - function get_archive_status( $post ) { - return phila_get_archive_status($post['id']); - } - - function get_phila_categories ( $post ) { - return phila_get_the_category($post['id']); - } - - function get_phila_tags ( $post ) { - return get_the_tags($post['id']); - } } function create_phila_press_release() { register_post_type( 'press_release', diff --git a/wp/wp-content/plugins/phila.gov-customization/index.php b/wp/wp-content/plugins/phila.gov-customization/index.php index a3ecf22ad2..0a3c62604f 100644 --- a/wp/wp-content/plugins/phila.gov-customization/index.php +++ b/wp/wp-content/plugins/phila.gov-customization/index.php @@ -105,4 +105,6 @@ require $dir. '/public/hostname-redirect.php'; require $dir. '/public/modify-post-type-links.php'; require $dir. '/public/removals.php'; -require $dir. '/public/rewrite-rules.php'; \ No newline at end of file +require $dir. '/public/rewrite-rules.php'; + +require $dir. '/public/controllers/v2/class-phila-posts-v2.php'; \ No newline at end of file diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php index d931147360..d463ce0a88 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php @@ -549,5 +549,3 @@ function phila_register_archives_rest_routes() { } add_action( 'rest_api_init', 'phila_register_archives_rest_routes' ); - - diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php new file mode 100644 index 0000000000..1003d20b14 --- /dev/null +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php @@ -0,0 +1,237 @@ + 'get_archive_status' )); +register_rest_field( 'post', 'categories', array( 'get_callback' => 'get_phila_categories' )); +register_rest_field( 'post', 'template', array( 'get_callback' => 'get_phila_template' )); +register_rest_field( 'post', 'tags', array( 'get_callback' => 'get_phila_tags' )); +// register_rest_field( 'post', 'language', array( 'get_callback' => 'get_phila_language' )); + +// add filter functionality +add_filter( 'rest_post_query', 'filter_post_by_archived', 10, 2 ); +add_filter( 'rest_post_query', 'filter_post_by_featured', 10, 2 ); +add_filter( 'rest_post_query', 'filter_post_by_language', 10, 2 ); +// register_rest_field( 'post', 'post_search', array( 'get_callback' => 'search_posts') ); +// add count of total items in pages + + +function get_phila_template( $post ) { + return phila_get_selected_template($post['id'], true, true); +} + +function get_archive_status( $post ) { + return phila_get_archive_status($post['id']); +} + +function get_phila_categories ( $post ) { + return phila_get_the_category($post['id']); +} + +function get_phila_tags ( $post ) { + return get_the_tags($post['id']); +} + +// function get_phila_language ( $post ) { +// $language = rwmb_meta('phila_select_language', '', $post['id']); +// if ( empty( $language ) ) { +// $language = 'english'; +// } +// return $language; +// } + +function filter_post_by_archived( $args, $request ) { + $archived = $request->get_param( 'archived' ); + + if ( empty( $archived )) { + return $args; + } + + if ( $archived === 'true' ) { + $archived = 'archive_now'; + } else if ( $archived === 'false' ){ + $archived = 'default'; + } + + $args['meta_query'] = array( + array( + 'key' => 'phila_archive_post', + 'value' => $archived, + 'compare' => '=', + ), + ); + + return $args; +} + +function filter_post_by_featured( $args, $request ) { + $featured = $request->get_param( 'featured' ); + + if ( empty( $featured )) { + return $args; + } + + if ( $featured == 'true') { + $featured = 1; + } else if ( $featured == 'false' ){ + $featured = 0; + } + + $args['meta_query'] = array( + array( + 'key' => 'phila_is_feature', + 'value' => $featured, + 'compare' => '=', + ), + ); + + return $args; +} + +function filter_post_by_language( $args, $request ) { + $lang = $request->get_param( 'language' ); + + if ( empty( $lang )) { + return $args; + } + + $args['meta_query'] = array( + array( + 'key' => 'phila_select_language', + 'value' => $lang, + 'compare' => '=', + ), + ); + + return $args; +} + + +// function search_posts( $object, $field_name, $request ) { + // $args = array( + // 'post_type' => 'post', + // 's' => sanitize_text_field( $request['search'] ), + // ); + // $query = new WP_Query( $args ); + // $results = array(); + // if ( $query->have_posts() ) { + // while ( $query->have_posts() ) { + // $query->the_post(); + // $item = array( + // 'id' => get_the_ID(), + // 'title' => get_the_title(), + // 'url' => get_permalink(), + // ); + // $results[] = $item; + // } + // wp_reset_postdata(); + // } + // return $results; + // } + + + // register_rest_route( 'wp/v2', '/search/(?P[a-zA-Z0-9-_]+)/(?P[a-zA-Z0-9-_]+)', array( + // 'methods' => 'GET', + // 'callback' => 'my_search_callback', + // 'args' => array( + // 'query' => array( + // 'required' => true, + // 'validate_callback' => function($param, $request, $key) { + // return !empty($param); + // }, + // ), + // 'page' => array( + // 'default' => 1, + // 'validate_callback' => function($param, $request, $key) { + // return is_numeric($param) && intval($param) > 0; + // }, + // ), + // 'per_page' => array( + // 'default' => 10, + // 'validate_callback' => function($param, $request, $key) { + // return is_numeric($param) && intval($param) > 0 && intval($param) <= 100; + // }, + // ), + // ), + // ) ); + + +// function my_search_callback1( WP_REST_Request $request ) { +// $query = $request->get_param('query'); +// $post_type = $request->get_param('post_type'); +// $page = $request->get_param('page'); +// $per_page = $request->get_param('per_page'); + +// $args = array( +// 's' => $query, +// 'post_type' => $post_type, +// 'post_status' => 'publish', +// 'orderby' => 'date', +// 'order' => 'DESC', +// 'posts_per_page' => $per_page, +// 'paged' => $page, +// ); + +// $posts = get_posts( $args ); + +// $response = array( +// 'results' => $posts, +// 'total' => wp_count_posts($post_type)->publish, +// 'pages' => ceil( wp_count_posts($post_type)->publish / $per_page ), +// ); + +// return rest_ensure_response( $response ); +// } + +// add_action( 'rest_api_init', function() { +// register_rest_route( 'wp/v2', '/search/(?P[a-zA-Z0-9-_]+)/(?P[a-zA-Z0-9-_]+)', array( +// 'methods' => 'GET', +// 'callback' => 'my_search_callback', +// 'args' => array( +// 'query' => array( +// 'required' => true, +// 'validate_callback' => function($param, $request, $key) { +// return !empty($param); +// }, +// ), +// 'page' => array( +// 'default' => 1, +// 'validate_callback' => function($param, $request, $key) { +// return is_numeric($param) && intval($param) > 0; +// }, +// ), +// 'per_page' => array( +// 'default' => 10, +// 'validate_callback' => function($param, $request, $key) { +// return is_numeric($param) && intval($param) > 0 && intval($param) <= 100; +// }, +// ), +// ), +// ) ); +// } ); + +// function my_search_callback( WP_REST_Request $request ) { +// $query = $request->get_param('query'); +// $post_type = $request->get_param('post_type'); +// $page = $request->get_param('page'); +// $per_page = $request->get_param('per_page'); + +// $args = array( +// 's' => $query, +// 'post_type' => $post_type, +// 'post_status' => 'publish', +// 'orderby' => 'date', +// 'order' => 'DESC', +// 'posts_per_page' => $per_page, +// 'paged' => $page, +// ); + +// $posts = get_posts( $args ); + +// $response = array( +// 'results' => $posts, +// 'total' => wp_count_posts($post_type)->publish, +// 'pages' => ceil( wp_count_posts($post_type)->publish / $per_page ), +// ); + +// return rest_ensure_response( $response ); +// } From 82ea8d57454bbabb9cdb2f54a900e8760da9c25f Mon Sep 17 00:00:00 2001 From: derrickdso Date: Mon, 8 May 2023 11:29:17 -0400 Subject: [PATCH 003/209] get featured media and tags --- .../class-phila-gov-custom-taxonomies.php | 2 + .../controllers/v2/class-phila-posts-v2.php | 157 ++---------------- 2 files changed, 13 insertions(+), 146 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php index b0da9749d9..545c498ccb 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php @@ -203,7 +203,9 @@ function hierarchical_tags() { 'public' => true, 'show_ui' => true, 'show_admin_column' => true, + 'show_in_rest' => true, '_builtin' => true, + 'rest_base' => 'tags', ) ); } } diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php index 1003d20b14..13e7caa645 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php @@ -1,18 +1,16 @@ 'get_archive_status' )); -register_rest_field( 'post', 'categories', array( 'get_callback' => 'get_phila_categories' )); -register_rest_field( 'post', 'template', array( 'get_callback' => 'get_phila_template' )); -register_rest_field( 'post', 'tags', array( 'get_callback' => 'get_phila_tags' )); -// register_rest_field( 'post', 'language', array( 'get_callback' => 'get_phila_language' )); +register_rest_field( 'post', 'archived', array( 'get_callback' => 'get_archive_status' )); +register_rest_field( 'post', 'categories', array( 'get_callback' => 'get_phila_categories' )); +register_rest_field( 'post', 'template', array( 'get_callback' => 'get_phila_template' )); +register_rest_field( 'post', 'tags', array( 'get_callback' => 'get_phila_tags' )); +register_rest_field( 'post', 'featured_media', array( 'get_callback' => 'get_phila_featured_media' )); // add filter functionality add_filter( 'rest_post_query', 'filter_post_by_archived', 10, 2 ); add_filter( 'rest_post_query', 'filter_post_by_featured', 10, 2 ); add_filter( 'rest_post_query', 'filter_post_by_language', 10, 2 ); -// register_rest_field( 'post', 'post_search', array( 'get_callback' => 'search_posts') ); -// add count of total items in pages function get_phila_template( $post ) { @@ -31,13 +29,11 @@ function get_phila_tags ( $post ) { return get_the_tags($post['id']); } -// function get_phila_language ( $post ) { -// $language = rwmb_meta('phila_select_language', '', $post['id']); -// if ( empty( $language ) ) { -// $language = 'english'; -// } -// return $language; -// } +function get_phila_featured_media ( $post ) { + $featured_image_id = get_post_thumbnail_id($post['id']); + $medium_featured_image_url = wp_get_attachment_image_src($featured_image_id, 'medium')[0]; + return $medium_featured_image_url; +} function filter_post_by_archived( $args, $request ) { $archived = $request->get_param( 'archived' ); @@ -103,135 +99,4 @@ function filter_post_by_language( $args, $request ) { ); return $args; -} - - -// function search_posts( $object, $field_name, $request ) { - // $args = array( - // 'post_type' => 'post', - // 's' => sanitize_text_field( $request['search'] ), - // ); - // $query = new WP_Query( $args ); - // $results = array(); - // if ( $query->have_posts() ) { - // while ( $query->have_posts() ) { - // $query->the_post(); - // $item = array( - // 'id' => get_the_ID(), - // 'title' => get_the_title(), - // 'url' => get_permalink(), - // ); - // $results[] = $item; - // } - // wp_reset_postdata(); - // } - // return $results; - // } - - - // register_rest_route( 'wp/v2', '/search/(?P[a-zA-Z0-9-_]+)/(?P[a-zA-Z0-9-_]+)', array( - // 'methods' => 'GET', - // 'callback' => 'my_search_callback', - // 'args' => array( - // 'query' => array( - // 'required' => true, - // 'validate_callback' => function($param, $request, $key) { - // return !empty($param); - // }, - // ), - // 'page' => array( - // 'default' => 1, - // 'validate_callback' => function($param, $request, $key) { - // return is_numeric($param) && intval($param) > 0; - // }, - // ), - // 'per_page' => array( - // 'default' => 10, - // 'validate_callback' => function($param, $request, $key) { - // return is_numeric($param) && intval($param) > 0 && intval($param) <= 100; - // }, - // ), - // ), - // ) ); - - -// function my_search_callback1( WP_REST_Request $request ) { -// $query = $request->get_param('query'); -// $post_type = $request->get_param('post_type'); -// $page = $request->get_param('page'); -// $per_page = $request->get_param('per_page'); - -// $args = array( -// 's' => $query, -// 'post_type' => $post_type, -// 'post_status' => 'publish', -// 'orderby' => 'date', -// 'order' => 'DESC', -// 'posts_per_page' => $per_page, -// 'paged' => $page, -// ); - -// $posts = get_posts( $args ); - -// $response = array( -// 'results' => $posts, -// 'total' => wp_count_posts($post_type)->publish, -// 'pages' => ceil( wp_count_posts($post_type)->publish / $per_page ), -// ); - -// return rest_ensure_response( $response ); -// } - -// add_action( 'rest_api_init', function() { -// register_rest_route( 'wp/v2', '/search/(?P[a-zA-Z0-9-_]+)/(?P[a-zA-Z0-9-_]+)', array( -// 'methods' => 'GET', -// 'callback' => 'my_search_callback', -// 'args' => array( -// 'query' => array( -// 'required' => true, -// 'validate_callback' => function($param, $request, $key) { -// return !empty($param); -// }, -// ), -// 'page' => array( -// 'default' => 1, -// 'validate_callback' => function($param, $request, $key) { -// return is_numeric($param) && intval($param) > 0; -// }, -// ), -// 'per_page' => array( -// 'default' => 10, -// 'validate_callback' => function($param, $request, $key) { -// return is_numeric($param) && intval($param) > 0 && intval($param) <= 100; -// }, -// ), -// ), -// ) ); -// } ); - -// function my_search_callback( WP_REST_Request $request ) { -// $query = $request->get_param('query'); -// $post_type = $request->get_param('post_type'); -// $page = $request->get_param('page'); -// $per_page = $request->get_param('per_page'); - -// $args = array( -// 's' => $query, -// 'post_type' => $post_type, -// 'post_status' => 'publish', -// 'orderby' => 'date', -// 'order' => 'DESC', -// 'posts_per_page' => $per_page, -// 'paged' => $page, -// ); - -// $posts = get_posts( $args ); - -// $response = array( -// 'results' => $posts, -// 'total' => wp_count_posts($post_type)->publish, -// 'pages' => ceil( wp_count_posts($post_type)->publish / $per_page ), -// ); - -// return rest_ensure_response( $response ); -// } +} \ No newline at end of file From 2f0f168f4e1aed175e9807f930461cbf8c2176fc Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Wed, 10 May 2023 14:48:27 -0400 Subject: [PATCH 004/209] add check for null images --- .../public/controllers/v2/class-phila-posts-v2.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php index 13e7caa645..51656d40b7 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php @@ -31,8 +31,12 @@ function get_phila_tags ( $post ) { function get_phila_featured_media ( $post ) { $featured_image_id = get_post_thumbnail_id($post['id']); - $medium_featured_image_url = wp_get_attachment_image_src($featured_image_id, 'medium')[0]; - return $medium_featured_image_url; + if ( $featured_image_id !== 0) { + $medium_featured_image_url = wp_get_attachment_image_src($featured_image_id, 'medium')[0]; + return $medium_featured_image_url; + } + return null; + } function filter_post_by_archived( $args, $request ) { From 88e53afd0fac872cafc2c0fa4a649cfc9e721532 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Wed, 17 May 2023 15:10:44 -0400 Subject: [PATCH 005/209] announcements endpoint --- .../admin/class-phila-gov-custom-post-types.php | 1 + wp/wp-content/plugins/phila.gov-customization/index.php | 1 + 2 files changed, 2 insertions(+) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index 32f5f365b6..b656287812 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -125,6 +125,7 @@ function create_phila_annoucement() { ), 'exclude_from_search' => true, 'show_in_rest' => true, + 'rest_base' => 'announcements', 'public' => false, 'show_ui' => true, 'has_archive' => false, diff --git a/wp/wp-content/plugins/phila.gov-customization/index.php b/wp/wp-content/plugins/phila.gov-customization/index.php index 0a3c62604f..81e100d1b8 100644 --- a/wp/wp-content/plugins/phila.gov-customization/index.php +++ b/wp/wp-content/plugins/phila.gov-customization/index.php @@ -107,4 +107,5 @@ require $dir. '/public/removals.php'; require $dir. '/public/rewrite-rules.php'; +require $dir. '/public/controllers/v2/class-phila-announcements-v2.php'; require $dir. '/public/controllers/v2/class-phila-posts-v2.php'; \ No newline at end of file From bf5109675af76ee582c0bb09dabbdf8b0ffaef4e Mon Sep 17 00:00:00 2001 From: derrickdso Date: Wed, 17 May 2023 16:21:53 -0400 Subject: [PATCH 006/209] announcements and spotlights --- .../event-spotlight/class-phila-gov-cpt-event-spotlight.php | 2 +- wp/wp-content/plugins/phila.gov-customization/index.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php b/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php index f1d17c41b7..ba7f364be4 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php @@ -42,7 +42,7 @@ function create_phila_event_spotlight() { 'public' => true, 'has_archive' => true, 'show_in_rest' => true, - 'rest_base' => 'spotlight', + 'rest_base' => 'spotlights', 'show_in_nav_menus' => true, 'menu_icon' => 'dashicons-calendar', 'hierarchical' => true, diff --git a/wp/wp-content/plugins/phila.gov-customization/index.php b/wp/wp-content/plugins/phila.gov-customization/index.php index 81e100d1b8..fcaeefda07 100644 --- a/wp/wp-content/plugins/phila.gov-customization/index.php +++ b/wp/wp-content/plugins/phila.gov-customization/index.php @@ -108,4 +108,5 @@ require $dir. '/public/rewrite-rules.php'; require $dir. '/public/controllers/v2/class-phila-announcements-v2.php'; -require $dir. '/public/controllers/v2/class-phila-posts-v2.php'; \ No newline at end of file +require $dir. '/public/controllers/v2/class-phila-posts-v2.php'; +require $dir. '/public/controllers/v2/class-phila-spotlights-v2.php'; \ No newline at end of file From 72d1e1532f2eea20f11ad4fa5dc6e35ffe8385b4 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Wed, 17 May 2023 16:21:59 -0400 Subject: [PATCH 007/209] announcements and spotlights 2 --- .../v2/class-phila-announcements-v2.php | 13 ++++++ .../v2/class-phila-spotlights-v2.php | 41 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-announcements-v2.php create mode 100644 wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-spotlights-v2.php diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-announcements-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-announcements-v2.php new file mode 100644 index 0000000000..1260e2566d --- /dev/null +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-announcements-v2.php @@ -0,0 +1,13 @@ + 'get_phila_announcement_categories' )); +register_rest_field( 'announcement', 'tags', array( 'get_callback' => 'get_phila_announcement_tags' )); + +function get_phila_announcement_categories ( $post ) { + return phila_get_the_category($post['id']); +} + +function get_phila_announcement_tags ( $post ) { + return get_the_tags($post['id']); +} \ No newline at end of file diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-spotlights-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-spotlights-v2.php new file mode 100644 index 0000000000..be93fac4d9 --- /dev/null +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-spotlights-v2.php @@ -0,0 +1,41 @@ + 'get_phila_spotlights_categories' )); +register_rest_field( 'event_spotlight', 'active', array( 'get_callback' => 'get_phila_spotlights_active' )); + +// add filter functionality +add_filter( 'rest_event_spotlight_query', 'filter_spotlight_by_active', 10, 2 ); + +function get_phila_spotlights_categories ( $post ) { + return phila_get_the_category($post['id']); +} + +function get_phila_spotlights_active( $post ) { + $is_active = rwmb_meta('spotlight_is_active', '', $post['id']); + return (bool) $is_active; +} + +function filter_spotlight_by_active( $args, $request ) { + $active = $request->get_param( 'active' ); + + if ( empty( $active )) { + return $args; + } + + if ( $active === 'true' ) { + $active = 1; + } else if ( $active === 'false' ){ + $active = 0; + } + + $args['meta_query'] = array( + array( + 'key' => 'spotlight_is_active', + 'value' => $active, + 'compare' => '=', + ), + ); + + return $args; +} \ No newline at end of file From f1d1b80c4d9a1cbdf118ae47a54775a841a8a2f4 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Fri, 7 Jul 2023 10:46:57 -0400 Subject: [PATCH 008/209] starting sitewide alerts --- .../class-phila-gov-custom-post-types.php | 27 +++++++------ .../admin/class-phila-gov-site-wide-alert.php | 8 ---- .../v2/class-phila-site-wide-alerts-v2.php | 38 +++++++++++++++++++ 3 files changed, 53 insertions(+), 20 deletions(-) create mode 100644 wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index 0ed08b3377..33103dbdcf 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -193,18 +193,21 @@ function create_phila_site_wide_alert() { 'not_found' => __( 'Site-wide Alert not found' ), 'not_found_in_trash' => __( 'Site-wide Alert not found in trash' ), ), - 'taxonomies' => array('category'), - 'exclude_from_search' => true, - 'public' => false, - 'show_ui' => true, - 'has_archive' => false, - 'menu_icon' => 'dashicons-megaphone', - 'hierarchical' => false, - 'rewrite' => array( - 'slug' => 'alerts', - 'with_front' => false, - ), - ) + 'taxonomies' => array('category'), + 'exclude_from_search' => true, + 'show_in_rest' => true, + 'rest_base' => 'alerts', + 'public' => false, + 'show_ui' => true, + 'has_archive' => false, + 'menu_icon' => 'dashicons-megaphone', + 'hierarchical' => true, + 'query_var' => true, + 'rewrite' => array( + 'slug' => 'alerts', + 'with_front' => false, + ), + ) ); } diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php index c6f7eba15c..6d32a08fcb 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php @@ -65,12 +65,8 @@ function phila_register_meta_boxes( $meta_boxes ){ 'dateFormat'=>'mm-dd-yy', 'stepMinute' => 15, 'showHour' => 'true', - //'altField' => '#phila_start_hidden', - //'altFormat'=> "@", - //'altFieldTimeOnly' => false, 'controlType'=> 'select', 'oneLine'=> true, - //'altTimeFormat' => 'c', 'timeInput' => true, ), 'timestamp' => true @@ -89,12 +85,8 @@ function phila_register_meta_boxes( $meta_boxes ){ 'dateFormat' => 'mm-dd-yy', 'stepMinute' => 15, 'showHour' => 'true', - //'altField' => '#phila_end_hidden', - //'altFormat'=> "@", - //'altFieldTimeOnly' => false, 'controlType'=> 'select', 'oneLine'=> true, - //'altTimeFormat' => 'c', 'timeInput' => true ), 'timestamp' => true diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php new file mode 100644 index 0000000000..c460668e17 --- /dev/null +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php @@ -0,0 +1,38 @@ + 'get_phila_spotlights_categories' )); +// register_rest_field( 'site_wide_alert', 'active', array( 'get_callback' => 'get_phila_spotlights_active' )); + +// add filter functionality +add_filter( 'rest_site_wide_alert_query', 'filter_spotlight_by_active', 10, 2 ); + +function filter_spotlight_by_active( $args, $request ) { + $active = $request->get_param( 'active' ); + + if ( empty( $active )) { + return $args; + } + + // if active toggle is true + // if between active dates + + // else send none + + + if ( $active === 'true' ) { + $active = 1; + } else if ( $active === 'false' ){ + $active = 0; + } + + $args['meta_query'] = array( + array( + 'key' => 'spotlight_is_active', + 'value' => $active, + 'compare' => '=', + ), + ); + + return $args; +} \ No newline at end of file From a5d9a13b959fa0d4c42140903165e85caa381e13 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Fri, 14 Jul 2023 13:19:24 -0400 Subject: [PATCH 009/209] temp --- .../class-phila-gov-custom-post-types.php | 1 - .../admin/class-phila-gov-site-wide-alert.php | 22 +++--- .../plugins/phila.gov-customization/index.php | 4 +- .../v2/class-phila-site-wide-alerts-v2.php | 75 ++++++++++++++----- 4 files changed, 69 insertions(+), 33 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index 33103dbdcf..bcb35b712b 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -193,7 +193,6 @@ function create_phila_site_wide_alert() { 'not_found' => __( 'Site-wide Alert not found' ), 'not_found_in_trash' => __( 'Site-wide Alert not found in trash' ), ), - 'taxonomies' => array('category'), 'exclude_from_search' => true, 'show_in_rest' => true, 'rest_base' => 'alerts', diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php index 6d32a08fcb..14c32a02d1 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php @@ -59,17 +59,17 @@ function phila_register_meta_boxes( $meta_boxes ){ 'class' => 'start-time', 'type' => 'datetime', 'size' => 25, - 'hidden' => array( 'active', '=', 1), - 'js_options' => array( - 'timeFormat' => 'hh:mm tt', - 'dateFormat'=>'mm-dd-yy', - 'stepMinute' => 15, - 'showHour' => 'true', - 'controlType'=> 'select', - 'oneLine'=> true, - 'timeInput' => true, - ), - 'timestamp' => true + // 'hidden' => array( 'active', '=', 1), + // 'js_options' => array( + // 'timeFormat' => 'hh:mm tt', + // 'dateFormat'=>'mm-dd-yy', + // 'stepMinute' => 15, + // 'showHour' => 'true', + // 'controlType'=> 'select', + // 'oneLine'=> true, + // 'timeInput' => true, + // ), + // 'timestamp' => true ), array( diff --git a/wp/wp-content/plugins/phila.gov-customization/index.php b/wp/wp-content/plugins/phila.gov-customization/index.php index a3ecf22ad2..7165f0c716 100644 --- a/wp/wp-content/plugins/phila.gov-customization/index.php +++ b/wp/wp-content/plugins/phila.gov-customization/index.php @@ -105,4 +105,6 @@ require $dir. '/public/hostname-redirect.php'; require $dir. '/public/modify-post-type-links.php'; require $dir. '/public/removals.php'; -require $dir. '/public/rewrite-rules.php'; \ No newline at end of file +require $dir. '/public/rewrite-rules.php'; + +require $dir. '/public/controllers/v2/class-phila-site-wide-alerts-v2.php'; \ No newline at end of file diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php index c460668e17..eecc9b33a8 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php @@ -2,37 +2,72 @@ // register custom fields // register_rest_field( 'site_wide_alert', 'categories', array( 'get_callback' => 'get_phila_spotlights_categories' )); -// register_rest_field( 'site_wide_alert', 'active', array( 'get_callback' => 'get_phila_spotlights_active' )); +// register_rest_field( 'site_wide_alert', 'is_active', array( 'get_callback' => 'get_phila_spotlights_active' )); // add filter functionality -add_filter( 'rest_site_wide_alert_query', 'filter_spotlight_by_active', 10, 2 ); +add_filter( 'rest_site_wide_alert_query', 'filter_site_wide_alert_by_active', 10, 2 ); -function filter_spotlight_by_active( $args, $request ) { - $active = $request->get_param( 'active' ); +function get_phila_spotlights_active( $post ) { + $phila_alert_start = rwmb_meta('phila_alert_start', '', $post['id']); + $phila_alert_end = rwmb_meta('phila_alert_end', '', $post['id']); + $phila_alert_active = rwmb_meta('phila_alert_active', '', $post['id']); + $alert_start = date( 'Y-m-d', $phila_alert_start ); + $alert_end = date( 'Y-m-d', $phila_alert_end ); + $now = current_datetime()->format('Y-m-d'); - if ( empty( $active )) { - return $args; + if ($alert_start <= $now && $alert_end >= $now || $phila_alert_active ) { + return true; } + return false; +} - // if active toggle is true - // if between active dates +function filter_site_wide_alert_by_active( $args, $request ) { + $active = $request->get_param( 'active' ); + // $now = current_datetime()->format('Y-m-d'); + $today = date( 'Y/m/d' ); - // else send none + // if ( empty( $active )) { + // return $args; + // } + // if ( $active === 'true' ) { + // $active = 1; + // } else if ( $active === 'false' ){ + // $active = 0; + // } - if ( $active === 'true' ) { - $active = 1; - } else if ( $active === 'false' ){ - $active = 0; - } + // $args['meta_query'] = array( + // 'relation' => 'OR', + // array( + // 'relation' => 'AND', + // array( + // 'key' => 'phila_alert_start', + // 'value' => $now, + // 'compare' => '<=', + // 'type' => 'DATETIME', + // ), + // array( + // 'key' => 'phila_alert_end', + // 'value' => $now, + // 'compare' => '>=', + // 'type' => 'DATETIME', + // ), + // ), + // array( + // 'key' => 'phila_alert_active', + // 'value' => $active, + // 'compare' => '=', + // 'type' => 'BOOLEAN', + // ), + // ); $args['meta_query'] = array( - array( - 'key' => 'spotlight_is_active', - 'value' => $active, - 'compare' => '=', - ), + array( + 'key' => 'phila_alert_start', // Check the start date field + 'value' => current_time( 'mysql' ), + 'compare' => '>=', + 'type' => 'DATETIME' + ) ); - return $args; } \ No newline at end of file From 1350172223e6dc02be78dc30f90499026e16844c Mon Sep 17 00:00:00 2001 From: derrickdso Date: Mon, 17 Jul 2023 15:24:25 -0400 Subject: [PATCH 010/209] working endpoint --- .../admin/class-phila-gov-site-wide-alert.php | 22 ++--- .../v2/class-phila-site-wide-alerts-v2.php | 89 +++++++------------ 2 files changed, 42 insertions(+), 69 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php index 14c32a02d1..6d32a08fcb 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php @@ -59,17 +59,17 @@ function phila_register_meta_boxes( $meta_boxes ){ 'class' => 'start-time', 'type' => 'datetime', 'size' => 25, - // 'hidden' => array( 'active', '=', 1), - // 'js_options' => array( - // 'timeFormat' => 'hh:mm tt', - // 'dateFormat'=>'mm-dd-yy', - // 'stepMinute' => 15, - // 'showHour' => 'true', - // 'controlType'=> 'select', - // 'oneLine'=> true, - // 'timeInput' => true, - // ), - // 'timestamp' => true + 'hidden' => array( 'active', '=', 1), + 'js_options' => array( + 'timeFormat' => 'hh:mm tt', + 'dateFormat'=>'mm-dd-yy', + 'stepMinute' => 15, + 'showHour' => 'true', + 'controlType'=> 'select', + 'oneLine'=> true, + 'timeInput' => true, + ), + 'timestamp' => true ), array( diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php index eecc9b33a8..8cc33122df 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-site-wide-alerts-v2.php @@ -1,73 +1,46 @@ 'get_phila_spotlights_categories' )); -// register_rest_field( 'site_wide_alert', 'is_active', array( 'get_callback' => 'get_phila_spotlights_active' )); - // add filter functionality add_filter( 'rest_site_wide_alert_query', 'filter_site_wide_alert_by_active', 10, 2 ); -function get_phila_spotlights_active( $post ) { - $phila_alert_start = rwmb_meta('phila_alert_start', '', $post['id']); - $phila_alert_end = rwmb_meta('phila_alert_end', '', $post['id']); - $phila_alert_active = rwmb_meta('phila_alert_active', '', $post['id']); - $alert_start = date( 'Y-m-d', $phila_alert_start ); - $alert_end = date( 'Y-m-d', $phila_alert_end ); - $now = current_datetime()->format('Y-m-d'); - - if ($alert_start <= $now && $alert_end >= $now || $phila_alert_active ) { - return true; - } - return false; -} - function filter_site_wide_alert_by_active( $args, $request ) { - $active = $request->get_param( 'active' ); - // $now = current_datetime()->format('Y-m-d'); - $today = date( 'Y/m/d' ); - // if ( empty( $active )) { - // return $args; - // } + $active = $request->get_param( 'active' ); + $now = current_time('timestamp'); - // if ( $active === 'true' ) { - // $active = 1; - // } else if ( $active === 'false' ){ - // $active = 0; - // } + if ( empty( $active )) { + return $args; + } - // $args['meta_query'] = array( - // 'relation' => 'OR', - // array( - // 'relation' => 'AND', - // array( - // 'key' => 'phila_alert_start', - // 'value' => $now, - // 'compare' => '<=', - // 'type' => 'DATETIME', - // ), - // array( - // 'key' => 'phila_alert_end', - // 'value' => $now, - // 'compare' => '>=', - // 'type' => 'DATETIME', - // ), - // ), - // array( - // 'key' => 'phila_alert_active', - // 'value' => $active, - // 'compare' => '=', - // 'type' => 'BOOLEAN', - // ), - // ); + if ( $active === 'true' ) { + $active = 1; + } else if ( $active === 'false' ){ + $active = 0; + } $args['meta_query'] = array( + 'relation' => 'OR', + array( + 'relation' => 'AND', + array( + 'key' => 'phila_alert_start', + 'value' => $now, + 'compare' => '<=', + 'type' => 'integer', + ), + array( + 'key' => 'phila_alert_end', + 'value' => $now, + 'compare' => '>=', + 'type' => 'integer', + ), + ), array( - 'key' => 'phila_alert_start', // Check the start date field - 'value' => current_time( 'mysql' ), - 'compare' => '>=', - 'type' => 'DATETIME' - ) + 'key' => 'phila_alert_active', + 'value' => $active, + 'compare' => '=', + 'type' => 'BOOLEAN', + ), ); return $args; } \ No newline at end of file From d4238d1aafae93d4a925fa2234dfaf2d4df7d075 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Tue, 18 Jul 2023 17:01:12 -0400 Subject: [PATCH 011/209] remove extra code and import vue site wide alerts --- .../plugins/phila.gov-customization/index.php | 1 - ...ss-phila-gov-site-wide-alert-rendering.php | 116 ------------------ .../themes/phila.gov-theme/functions.php | 7 ++ .../themes/phila.gov-theme/header.php | 5 +- .../themes/phila.gov-theme/js/dev/main.js | 1 - .../js/dev/site-wide-alerts.js | 19 --- 6 files changed, 9 insertions(+), 140 deletions(-) delete mode 100644 wp/wp-content/plugins/phila.gov-customization/public/class-phila-gov-site-wide-alert-rendering.php delete mode 100644 wp/wp-content/themes/phila.gov-theme/js/dev/site-wide-alerts.js diff --git a/wp/wp-content/plugins/phila.gov-customization/index.php b/wp/wp-content/plugins/phila.gov-customization/index.php index 7165f0c716..ada255fd66 100644 --- a/wp/wp-content/plugins/phila.gov-customization/index.php +++ b/wp/wp-content/plugins/phila.gov-customization/index.php @@ -101,7 +101,6 @@ require $dir. '/public/controllers/class-phila-staff-members.php'; require $dir. '/public/add-headers.php'; -require $dir. '/public/class-phila-gov-site-wide-alert-rendering.php'; require $dir. '/public/hostname-redirect.php'; require $dir. '/public/modify-post-type-links.php'; require $dir. '/public/removals.php'; diff --git a/wp/wp-content/plugins/phila.gov-customization/public/class-phila-gov-site-wide-alert-rendering.php b/wp/wp-content/plugins/phila.gov-customization/public/class-phila-gov-site-wide-alert-rendering.php deleted file mode 100644 index 49eca1562b..0000000000 --- a/wp/wp-content/plugins/phila.gov-customization/public/class-phila-gov-site-wide-alert-rendering.php +++ /dev/null @@ -1,116 +0,0 @@ - 'site_wide_alert' ); - - $pages = get_posts( $args ); - - $args = array( - 'post_type' => array ('site_wide_alert'), - 'posts_per_page' => -1 - ); - - function dateTimeFormat($date) { - if ( !$date == '' ) { - $date_obj = new DateTime("@$date"); - if( strlen($date_obj->format('F')) > 5 ){ - $formatted_date = $date_obj->format('g:i a \o\n l, M\. d'); - } else { - $formatted_date = $date_obj->format('g:i a \o\n l, F d'); - } - echo str_replace(array('Sep','12:00 am','12:00 pm','am','pm'),array('Sept','midnight','noon','a.m.','p.m.'),$formatted_date); - } - } - - $alert_query = new WP_Query($args); - - if ( $alert_query->have_posts() ) { - - while ( $alert_query->have_posts() ) { - - $alert_query->the_post(); - - $alert_active = rwmb_meta( 'phila_alert_active'); - - $alert_start = rwmb_meta( 'phila_alert_start', $args = array('type' => 'datetime')); - $alert_end = rwmb_meta( 'phila_alert_end', $args = array('type' => 'datetime')); - $alert_color = rwmb_meta( 'phila_alert_color'); - $alert_icon = rwmb_meta( 'phila_alert_icon'); - - $date_seperator = ' to '; - if(($alert_start == '') || ($alert_end == '')){ - $date_seperator = ' '; - } - $now = current_time('timestamp'); - - if( $alert_active ) { ?> -
-
-
-
-
- -
- -
-

-
- -
- -
-
-
-
-
- = $now ) ){ ?> -
-
-
-
-
- -
-
-
-
-
-
-
-
-
- diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index d62c90c70a..3d7b1265a5 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -392,6 +392,7 @@ function phila_gov_scripts() { wp_script_add_data( 'html5shiv', 'conditional', 'lt IE 9' ); load_vue_mobile_menu(); + load_vue_site_wide_alerts(); if ( is_user_logged_in() ){ wp_enqueue_script( 'logged-in-js', get_stylesheet_directory_uri() . '/admin/js/front-end.js', array( 'phila-scripts' ), '', true ); @@ -2252,4 +2253,10 @@ function load_vue_mobile_menu() { wp_enqueue_script('mobile-menu-chunk-js', 'https://www.phila.gov/embedded/mobile-menu/production/js/chunk-vendors.js?cachebreaker', array(), null, true ); wp_enqueue_script('mobile-menu-app-js', 'https://www.phila.gov/embedded/mobile-menu/production/js/app.js?cachebreaker', array(), null, true ); wp_enqueue_style('mobile-menu-app-css', 'https://www.phila.gov/embedded/mobile-menu/production/css/app.css?cachebreaker'); +} + +function load_vue_site_wide_alerts() { + wp_enqueue_script('site-wide-alerts-chunk-js', 'https://www.phila.gov/embedded/site-wide-alerts/production/js/chunk-vendors.js?cachebreaker', array(), null, true ); + wp_enqueue_script('site-wide-alerts-app-js', 'https://www.phila.gov/embedded/site-wide-alerts/production/js/app.js?cachebreaker', array(), null, true ); + wp_enqueue_style('site-wide-alerts-app-css', 'https://www.phila.gov/embedded/site-wide-alerts/production/css/app.css?cachebreaker'); } \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/header.php b/wp/wp-content/themes/phila.gov-theme/header.php index 80d04484b6..2a98bfefc5 100644 --- a/wp/wp-content/themes/phila.gov-theme/header.php +++ b/wp/wp-content/themes/phila.gov-theme/header.php @@ -190,9 +190,8 @@
- +
+
Date: Thu, 20 Jul 2023 11:01:37 -0400 Subject: [PATCH 012/209] add filtering by template for posts endpoint --- .../controllers/v2/class-phila-posts-v2.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php index 51656d40b7..9e55aa12a6 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php @@ -11,6 +11,7 @@ add_filter( 'rest_post_query', 'filter_post_by_archived', 10, 2 ); add_filter( 'rest_post_query', 'filter_post_by_featured', 10, 2 ); add_filter( 'rest_post_query', 'filter_post_by_language', 10, 2 ); +add_filter( 'rest_post_query', 'filter_post_by_template', 10, 2 ); function get_phila_template( $post ) { @@ -102,5 +103,24 @@ function filter_post_by_language( $args, $request ) { ), ); + return $args; +} + +//add filter for template +function filter_post_by_template($args, $request) { + $template = $request->get_param( 'template' ); + + if ( empty( $template )) { + return $args; + } + + $args['meta_query'] = array( + array( + 'key' => 'phila_template_select', + 'value' => $template, + 'compare' => '=', + ), + ); + return $args; } \ No newline at end of file From 93fdc4afd76b6a69b9db1a554ad7304c988b9d6e Mon Sep 17 00:00:00 2001 From: derrickdso Date: Mon, 24 Jul 2023 16:04:51 -0400 Subject: [PATCH 013/209] env for site wide alerts --- wp/wp-content/themes/phila.gov-theme/functions.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index d7cc4581a1..3288fae3be 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -2286,7 +2286,8 @@ function load_vue_mobile_menu() { } function load_vue_site_wide_alerts() { - wp_enqueue_script('site-wide-alerts-chunk-js', 'https://www.phila.gov/embedded/site-wide-alerts/production/js/chunk-vendors.js?cachebreaker', array(), null, true ); - wp_enqueue_script('site-wide-alerts-app-js', 'https://www.phila.gov/embedded/site-wide-alerts/production/js/app.js?cachebreaker', array(), null, true ); - wp_enqueue_style('site-wide-alerts-app-css', 'https://www.phila.gov/embedded/site-wide-alerts/production/css/app.css?cachebreaker'); + global $phila_environment; + wp_enqueue_script('site-wide-alerts-chunk-js', 'https://www.phila.gov/embedded/site-wide-alerts/'.$phila_environment.'/js/chunk-vendors.js?cachebreaker', array(), null, true ); + wp_enqueue_script('site-wide-alerts-app-js', 'https://www.phila.gov/embedded/site-wide-alerts/'.$phila_environment.'/js/app.js?cachebreaker', array(), null, true ); + wp_enqueue_style('site-wide-alerts-app-css', 'https://www.phila.gov/embedded/site-wide-alerts/'.$phila_environment.'/css/app.css?cachebreaker'); } \ No newline at end of file From 60d8886f7396c382d67f9e4c0cc5fa5dfc1bd0bc Mon Sep 17 00:00:00 2001 From: derrickdso Date: Tue, 25 Jul 2023 11:01:51 -0400 Subject: [PATCH 014/209] move site wide banners to alerts vue app --- .../admin/class-phila-gov-site-wide-alert.php | 24 ++++++- .../admin/settings/phila-gov-settings.php | 67 ++----------------- .../phila.gov-theme/css/scss/_alerts.scss | 46 ------------- .../themes/phila.gov-theme/css/scss/base.scss | 1 - .../themes/phila.gov-theme/header.php | 1 - .../partials/global/site-wide-banner.php | 39 ----------- 6 files changed, 26 insertions(+), 152 deletions(-) delete mode 100644 wp/wp-content/themes/phila.gov-theme/css/scss/_alerts.scss delete mode 100644 wp/wp-content/themes/phila.gov-theme/partials/global/site-wide-banner.php diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php index 6d32a08fcb..93665703c3 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php @@ -38,6 +38,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'blue' => 'Blue', 'orange' => 'Orange', 'red' => 'Red', + 'gray' => 'Gray', ), ), array( @@ -59,7 +60,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'class' => 'start-time', 'type' => 'datetime', 'size' => 25, - 'hidden' => array( 'active', '=', 1), + 'hidden' => array( 'phila_alert_active', '=', 1), 'js_options' => array( 'timeFormat' => 'hh:mm tt', 'dateFormat'=>'mm-dd-yy', @@ -78,7 +79,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'type' => 'datetime', 'class' => 'end-time', 'size' => 25, - 'hidden' => array( 'active', '=', 1), + 'hidden' => array( 'phila_alert_active', '=', 1), 'desc' => 'Note: The start and end times communicate an alert’s length in the alert bar. Use the active alert feature to turn alerts on and ignore this setting.', 'js_options' => array( 'timeFormat' => 'hh:mm tt', @@ -92,6 +93,25 @@ function phila_register_meta_boxes( $meta_boxes ){ 'timestamp' => true ), + array( + 'id' => 'phila_alert_button_active', + 'name' => 'Adds a call to action button to alert', + 'type' => 'switch', + 'on_label' => 'Yes', + 'off_label' => 'No', + ), + array( + 'name' => 'Alert button text', + 'id' => 'phila_alert_button_text', + 'type' => 'text', + 'hidden' => array( 'phila_alert_button_active', '=', 0), + ), + array( + 'name' => 'Alert button URL', + 'type' => 'url', + 'id' => 'phila_alert_button_url', + 'hidden' => array( 'phila_alert_button_active', '=', 0), + ), ), );//site wide alert boxes return $meta_boxes; diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/settings/phila-gov-settings.php b/wp/wp-content/plugins/phila.gov-customization/admin/settings/phila-gov-settings.php index 9fab89d815..358cce3ac3 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/settings/phila-gov-settings.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/settings/phila-gov-settings.php @@ -9,11 +9,10 @@ function phila_options_page( $settings_pages ) { 'menu_title' => 'Phila.gov settings', 'menu_title' => 'phila.gov settings', 'tabs' => array( - 'general' => 'General Settings', - 'jobs' => 'Featured jobs', - 'closures' => 'Closures', - 'sitewide_settings' => 'Site-wide settings', - 'translations' => 'Translations' + 'general' => 'General Settings', + 'jobs' => 'Featured jobs', + 'closures' => 'Closures', + 'translations' => 'Translations' ), ); return $settings_pages; @@ -191,64 +190,6 @@ function prefix_options_meta_boxes( $meta_boxes ) { ), ); - - $meta_boxes[] = array( - 'id' => 'sitewide_settings', - 'title' => 'Sitewide settings', - 'settings_pages' => 'phila_gov', - 'tab' => 'sitewide_settings', - 'include' => array( - 'user_role' => array( 'administrator', 'editor' ), - ), - 'fields' => array( - array( - 'name' => 'Display site-wide banner', - 'desc' => 'When active, the site-wide banner will be displayed on all pages', - 'id' => 'display_site_wide_banner', - 'type' => 'radio', - 'inline' => false, - 'std' => '0', - 'options' => array( - '0' => 'Hide', - '1' => 'Display', - ) - ), - array( - 'type' => 'heading', - 'name' => 'Site-wide banner settings', - ), - array( - 'id' => 'heading_text', - 'name' => 'Heading text', - 'type' => 'text', - 'required' => true - ), - array( - 'id' => 'banner_subtext', - 'name' => 'Banner subtext', - 'type' => 'text', - 'required' => true - ), - array( - 'id' => 'button_text', - 'name' => 'Button text', - 'type' => 'text', - 'required' => true - ), - array( - 'id' => 'button_url', - 'name' => 'Button URL', - 'type' => 'url', - 'required' => true - ), - array( - 'id' => 'icon', - 'name' => 'Icon', - 'type' => 'text', - 'desc' => 'Example: fas fa-icon-name. You can find icons on Fontawesome.io.', - ), - ), - ); $meta_boxes[] = array( 'id' => 'phila_translations_settings', 'title' => 'Translations deployment settings', diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/_alerts.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/_alerts.scss deleted file mode 100644 index 726c340b75..0000000000 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/_alerts.scss +++ /dev/null @@ -1,46 +0,0 @@ -.site-wide-alert { - background: color(dark-ben-franklin); - color: white; - font-family: $body-font-family; - div { - font-size:14px; - } - a:link, a:visited{ - color: white; - text-decoration: underline; - font-size: 14px; - } - &.orange { - background: #F5A623; - color: color(dark-gray); - a:link, a:visited{ - color: color(dark-gray); - text-decoration: underline; - } - } - &.red { - background: #CC3000; - color: white; - a:link, a:visited{ - color: white; - text-decoration: underline; - } - } -} -.site-wide-banner { - min-height: 60px; - background-color: color(ghost-gray); - .banner-button{ - margin-top: 3px; - float: left; - } - .fas { - font-size: 28px; - } - .banner-deadline { - font-size: 14px; - } - .banner-text { - display: inline-block; - } -} diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss index 88f9d9481c..befc7798a0 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss @@ -37,7 +37,6 @@ @import 'table'; @import 'translations'; @import 'pagination'; -@import 'alerts'; @import 'timeline'; @import 'walk-ins'; diff --git a/wp/wp-content/themes/phila.gov-theme/header.php b/wp/wp-content/themes/phila.gov-theme/header.php index ab723395db..672f864ef1 100644 --- a/wp/wp-content/themes/phila.gov-theme/header.php +++ b/wp/wp-content/themes/phila.gov-theme/header.php @@ -192,7 +192,6 @@
-
'setting' ), 'phila_settings' ); - if(isset($site_banner_feature_flag) && $site_banner_feature_flag != 0) { - //declare variables - $banner_heading_text = rwmb_meta( 'heading_text', array( 'object_type' => 'setting' ), 'phila_settings' ); - $site_banner_subtext = rwmb_meta( 'banner_subtext', array( 'object_type' => 'setting' ), 'phila_settings' ); - $site_button_text = rwmb_meta( 'button_text', array( 'object_type' => 'setting' ), 'phila_settings' ); - $site_button_url = rwmb_meta( 'button_url', array( 'object_type' => 'setting' ), 'phila_settings' ); - $banner_icon = rwmb_meta( 'icon', array( 'object_type' => 'setting' ), 'phila_settings' ); - -?> -
-
-
-
-
- - - -
-
- -
-
- - - -
-
-
-
-
- \ No newline at end of file From a603239e5bccb8035518ba360c27244c3701d912 Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Tue, 25 Jul 2023 13:15:31 -0400 Subject: [PATCH 015/209] update custom post type to filter in sequence --- .../controllers/v2/class-phila-posts-v2.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php index 9e55aa12a6..6d9c8c5cf2 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php @@ -7,11 +7,16 @@ register_rest_field( 'post', 'tags', array( 'get_callback' => 'get_phila_tags' )); register_rest_field( 'post', 'featured_media', array( 'get_callback' => 'get_phila_featured_media' )); -// add filter functionality -add_filter( 'rest_post_query', 'filter_post_by_archived', 10, 2 ); -add_filter( 'rest_post_query', 'filter_post_by_featured', 10, 2 ); -add_filter( 'rest_post_query', 'filter_post_by_language', 10, 2 ); -add_filter( 'rest_post_query', 'filter_post_by_template', 10, 2 ); +function custom_post_type_rest_query_filter($args, $request) { + $args = filter_post_by_template($args, $request); + $args = filter_post_by_language($args, $request); + $args = filter_post_by_archived($args, $request); + $args = filter_post_by_featured($args, $request); + + return $args; +} + +add_filter('rest_post_query', 'custom_post_type_rest_query_filter', 10, 2); function get_phila_template( $post ) { From 027e2991986859f8b2a8d90b0f05ae7abb3c1652 Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Tue, 25 Jul 2023 13:23:09 -0400 Subject: [PATCH 016/209] fix filtering functions meta queries --- .../public/controllers/v2/class-phila-posts-v2.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php index 6d9c8c5cf2..1ec5df1bc3 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php @@ -58,7 +58,7 @@ function filter_post_by_archived( $args, $request ) { $archived = 'default'; } - $args['meta_query'] = array( + $args['meta_query'][] = array( array( 'key' => 'phila_archive_post', 'value' => $archived, @@ -82,7 +82,7 @@ function filter_post_by_featured( $args, $request ) { $featured = 0; } - $args['meta_query'] = array( + $args['meta_query'][] = array( array( 'key' => 'phila_is_feature', 'value' => $featured, @@ -100,7 +100,7 @@ function filter_post_by_language( $args, $request ) { return $args; } - $args['meta_query'] = array( + $args['meta_query'][] = array( array( 'key' => 'phila_select_language', 'value' => $lang, @@ -119,7 +119,7 @@ function filter_post_by_template($args, $request) { return $args; } - $args['meta_query'] = array( + $args['meta_query'][] = array( array( 'key' => 'phila_template_select', 'value' => $template, From 26d72d854c57feaaf3b7cb749f9cf3c74234c040 Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Tue, 25 Jul 2023 14:11:40 -0400 Subject: [PATCH 017/209] undo custom filter function which is unecessary since the meta query is now set in an array of arrays --- .../controllers/v2/class-phila-posts-v2.php | 47 +++++++------------ 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php index 1ec5df1bc3..9b5fb2e02d 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php @@ -7,17 +7,10 @@ register_rest_field( 'post', 'tags', array( 'get_callback' => 'get_phila_tags' )); register_rest_field( 'post', 'featured_media', array( 'get_callback' => 'get_phila_featured_media' )); -function custom_post_type_rest_query_filter($args, $request) { - $args = filter_post_by_template($args, $request); - $args = filter_post_by_language($args, $request); - $args = filter_post_by_archived($args, $request); - $args = filter_post_by_featured($args, $request); - - return $args; -} - -add_filter('rest_post_query', 'custom_post_type_rest_query_filter', 10, 2); - +add_filter( 'rest_post_query', 'filter_post_by_archived', 10, 2 ); +add_filter( 'rest_post_query', 'filter_post_by_featured', 10, 2 ); +add_filter( 'rest_post_query', 'filter_post_by_language', 10, 2 ); +add_filter( 'rest_post_query', 'filter_post_by_template', 10, 2 ); function get_phila_template( $post ) { return phila_get_selected_template($post['id'], true, true); @@ -59,11 +52,9 @@ function filter_post_by_archived( $args, $request ) { } $args['meta_query'][] = array( - array( - 'key' => 'phila_archive_post', - 'value' => $archived, - 'compare' => '=', - ), + 'key' => 'phila_archive_post', + 'value' => $archived, + 'compare' => '=', ); return $args; @@ -83,11 +74,9 @@ function filter_post_by_featured( $args, $request ) { } $args['meta_query'][] = array( - array( - 'key' => 'phila_is_feature', - 'value' => $featured, - 'compare' => '=', - ), + 'key' => 'phila_is_feature', + 'value' => $featured, + 'compare' => '=', ); return $args; @@ -101,11 +90,9 @@ function filter_post_by_language( $args, $request ) { } $args['meta_query'][] = array( - array( - 'key' => 'phila_select_language', - 'value' => $lang, - 'compare' => '=', - ), + 'key' => 'phila_select_language', + 'value' => $lang, + 'compare' => '=', ); return $args; @@ -120,11 +107,9 @@ function filter_post_by_template($args, $request) { } $args['meta_query'][] = array( - array( - 'key' => 'phila_template_select', - 'value' => $template, - 'compare' => '=', - ), + 'key' => 'phila_template_select', + 'value' => $template, + 'compare' => '=', ); return $args; From d8c38e2be10f5e4e610cf2591f948239261ab562 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Tue, 25 Jul 2023 15:09:42 -0400 Subject: [PATCH 018/209] no button --- .../admin/class-phila-gov-site-wide-alert.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php index 93665703c3..7fb8c8930c 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-site-wide-alert.php @@ -93,25 +93,6 @@ function phila_register_meta_boxes( $meta_boxes ){ 'timestamp' => true ), - array( - 'id' => 'phila_alert_button_active', - 'name' => 'Adds a call to action button to alert', - 'type' => 'switch', - 'on_label' => 'Yes', - 'off_label' => 'No', - ), - array( - 'name' => 'Alert button text', - 'id' => 'phila_alert_button_text', - 'type' => 'text', - 'hidden' => array( 'phila_alert_button_active', '=', 0), - ), - array( - 'name' => 'Alert button URL', - 'type' => 'url', - 'id' => 'phila_alert_button_url', - 'hidden' => array( 'phila_alert_button_active', '=', 0), - ), ), );//site wide alert boxes return $meta_boxes; From b97bdb6eec60788237dad7d3eb55e0453270cde4 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Fri, 28 Jul 2023 11:00:49 -0400 Subject: [PATCH 019/209] empty commit --- wp/wp-content/themes/phila.gov-theme/js/dev/translations.js | 1 + 1 file changed, 1 insertion(+) diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js b/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js index e32c1dd27d..e461bc0b51 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js @@ -160,3 +160,4 @@ module.exports = $(function () { //END Translation Bar }); + From 3dc6c6991914a5488724c8ccc2efd42c39e164e8 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Fri, 4 Aug 2023 08:06:56 -0400 Subject: [PATCH 020/209] member list component --- .../class-phila-gov-collection-page.php | 24 ++++++++++++++++++- .../class-phila-gov-row-metaboxes.php | 2 +- .../class-phila-gov-standard-metaboxes.php | 6 ++--- .../admin/meta-boxes/meta-boxes.php | 2 +- .../v2/board_commission_member_list.php | 2 +- .../departments/v2/collection-page.php | 4 ++++ 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php b/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php index 63379df425..862098550b 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php @@ -46,6 +46,7 @@ function register_collection_page_metaboxes( $meta_boxes ){ 'phila_callout_v2' => 'Callout', 'document' => 'Document pages [DEPRECATED]', 'free_text' => 'Free text area', + 'member_list' => 'Member list', 'paragraph_text_with_photo' => 'Paragraph text with photo', 'post' => 'Posts', 'press_releases' => 'Press releases', @@ -82,6 +83,27 @@ function register_collection_page_metaboxes( $meta_boxes ){ Phila_Gov_Standard_Metaboxes::phila_v2_service_page_selector( $multiple = true ), ) ), + array( + 'id' => 'commission_members', + 'type' => 'group', + 'clone' => false, + 'visible' => array('phila_collection_options', '=', 'member_list'), + 'fields' => array( + array( + 'id' => 'section_title', + 'name' => 'Section title', + 'type' => 'text', + 'desc' => 'Use this section to create an accordion-style list of people who don\'t formally work for the City of Philadelphia. List will appear in the order below.', + ), + array( + 'id' => 'table_head_title', + 'name' => 'Rename table title cell', + 'type' => 'text', + 'desc' => 'The staff table column label defaults to "title". Use this to change it.' + ), + Phila_Gov_Standard_Metaboxes::phila_meta_var_member_list() + ), + ), array( 'id' => 'posts', 'type' => 'group', @@ -244,7 +266,7 @@ function register_collection_page_metaboxes( $meta_boxes ){ ), ), ) - ); + ); return $meta_boxes; } diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php index d0af9f5031..4aa97c01a6 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php @@ -364,7 +364,7 @@ public static function phila_metabox_full_options( ){ 'type' => 'text', 'desc' => 'The staff table column label defaults to "title". Use this to change it.' ), - Phila_Gov_Standard_Metaboxes::phila_meta_var_commission_members() + Phila_Gov_Standard_Metaboxes::phila_meta_var_member_list() ), ), diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index 5b207c0104..bb8fc6214e 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1278,16 +1278,16 @@ public static function phila_meta_registration() { ); } - public static function phila_meta_var_commission_members(){ + public static function phila_meta_var_member_list($id = 'phila_commission_members'){ return array( - 'id' => 'phila_commission_members', + 'id' => $id, 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'add_button' => '+ Add member', 'fields' => array( array( - 'id' => 'full_name', + 'id' => 'full_name', 'name' => 'Full name', 'type' => 'text', 'desc' => 'Enter the full name, with honorific e.g.: Dr. Herbert West, PhD' diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php index e906021fc5..b786c20885 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php @@ -538,7 +538,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'type' => 'text', 'desc' => 'The staff table column label defaults to "title". Use this to change it.' ), - Phila_Gov_Standard_Metaboxes::phila_meta_var_commission_members() + Phila_Gov_Standard_Metaboxes::phila_meta_var_member_list() ), ); diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/board_commission_member_list.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/board_commission_member_list.php index c719a669b9..9dac686071 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/board_commission_member_list.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/board_commission_member_list.php @@ -5,7 +5,7 @@ $section_title = rwmb_meta('section_title'); endif; if ( !isset( $members ) ) : - $members = rwmb_meta('phila_commission_members'); + $members = rwmb_meta('phila_commission_members'); endif; if ( !isset( $table_cell_title ) ) : $table_cell_title = rwmb_meta('table_head_title'); diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php index e6f87a7abb..abeadeca99 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php @@ -162,6 +162,10 @@ + + + +
From 32cf69417ceeef447b230c8f5f0fb82857428ae8 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Tue, 15 Aug 2023 15:44:37 -0400 Subject: [PATCH 021/209] file removed --- wp/wp-content/plugins/phila.gov-customization/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/index.php b/wp/wp-content/plugins/phila.gov-customization/index.php index 0a377afd8d..30b81765bf 100644 --- a/wp/wp-content/plugins/phila.gov-customization/index.php +++ b/wp/wp-content/plugins/phila.gov-customization/index.php @@ -109,5 +109,4 @@ require $dir. '/public/controllers/v2/class-phila-site-wide-alerts-v2.php'; require $dir. '/public/controllers/v2/class-phila-announcements-v2.php'; require $dir. '/public/controllers/v2/class-phila-posts-v2.php'; -require $dir. '/public/controllers/v2/class-phila-site-wide-alerts-v2.php'; require $dir. '/public/controllers/v2/class-phila-spotlights-v2.php'; From 74552b68de786ecbc8b0fc4e9d5aa6ab15f5a11b Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Wed, 23 Aug 2023 14:08:52 -0400 Subject: [PATCH 022/209] file updated to member_list --- .../partials/departments/content-programs-initiatives.php | 2 +- .../partials/departments/phila_staff_directory_listing.php | 2 +- .../phila.gov-theme/partials/departments/v2/collection-page.php | 2 +- .../v2/{board_commission_member_list.php => member_list.php} | 2 +- .../partials/departments/v2/user_templates/homepage_v2.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename wp/wp-content/themes/phila.gov-theme/partials/departments/v2/{board_commission_member_list.php => member_list.php} (98%) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/content-programs-initiatives.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/content-programs-initiatives.php index 069e1b93e7..56cedd1e52 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/content-programs-initiatives.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/content-programs-initiatives.php @@ -258,7 +258,7 @@ $members = $current_row['phila_full_options']['commission_members']['phila_commission_members']; ?> - + diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_staff_directory_listing.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_staff_directory_listing.php index 94d7c73d3f..cc27a5c6af 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_staff_directory_listing.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_staff_directory_listing.php @@ -124,5 +124,5 @@ }?> - + diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php index abeadeca99..3a647df730 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php @@ -164,7 +164,7 @@ - +
diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/board_commission_member_list.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/member_list.php similarity index 98% rename from wp/wp-content/themes/phila.gov-theme/partials/departments/v2/board_commission_member_list.php rename to wp/wp-content/themes/phila.gov-theme/partials/departments/v2/member_list.php index 9dac686071..675180ae63 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/board_commission_member_list.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/member_list.php @@ -5,7 +5,7 @@ $section_title = rwmb_meta('section_title'); endif; if ( !isset( $members ) ) : - $members = rwmb_meta('phila_commission_members'); + $members = rwmb_meta('phila_members_list'); endif; if ( !isset( $table_cell_title ) ) : $table_cell_title = rwmb_meta('table_head_title'); diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/user_templates/homepage_v2.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/user_templates/homepage_v2.php index cf730b35ce..3ee13c5d28 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/user_templates/homepage_v2.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/user_templates/homepage_v2.php @@ -62,7 +62,7 @@ 'type'=>'v1', 'shown'=>true ), - 'board_commission_member_list' => array( + 'member_list' => array( 'type'=>'v2', 'shown'=> true, ), From dd1701b77c53f9897e5781e5dd5f0fa55009b90b Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Wed, 23 Aug 2023 15:42:21 -0400 Subject: [PATCH 023/209] update object name to members --- .../departments/templates/class-phila-gov-collection-page.php | 4 ++-- .../admin/meta-boxes/class-phila-gov-standard-metaboxes.php | 2 +- .../partials/departments/v2/collection-page.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php b/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php index 862098550b..b6411ed9c0 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php @@ -84,7 +84,7 @@ function register_collection_page_metaboxes( $meta_boxes ){ ) ), array( - 'id' => 'commission_members', + 'id' => 'member_list', 'type' => 'group', 'clone' => false, 'visible' => array('phila_collection_options', '=', 'member_list'), @@ -101,7 +101,7 @@ function register_collection_page_metaboxes( $meta_boxes ){ 'type' => 'text', 'desc' => 'The staff table column label defaults to "title". Use this to change it.' ), - Phila_Gov_Standard_Metaboxes::phila_meta_var_member_list() + Phila_Gov_Standard_Metaboxes::phila_meta_var_member_list('members') ), ), array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index bb8fc6214e..43569d01fd 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1278,7 +1278,7 @@ public static function phila_meta_registration() { ); } - public static function phila_meta_var_member_list($id = 'phila_commission_members'){ + public static function phila_meta_var_member_list ($id = 'phila_commission_members'){ return array( 'id' => $id, 'type' => 'group', diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php index 3a647df730..238bfd22e2 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php @@ -163,7 +163,7 @@ - + From 3beb4f502dcfd536f597bc5407edbc805b5da6d8 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Wed, 23 Aug 2023 15:50:34 -0400 Subject: [PATCH 024/209] table title field removed --- .../templates/class-phila-gov-collection-page.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php b/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php index b6411ed9c0..8d7cfb076c 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php @@ -95,12 +95,6 @@ function register_collection_page_metaboxes( $meta_boxes ){ 'type' => 'text', 'desc' => 'Use this section to create an accordion-style list of people who don\'t formally work for the City of Philadelphia. List will appear in the order below.', ), - array( - 'id' => 'table_head_title', - 'name' => 'Rename table title cell', - 'type' => 'text', - 'desc' => 'The staff table column label defaults to "title". Use this to change it.' - ), Phila_Gov_Standard_Metaboxes::phila_meta_var_member_list('members') ), ), From 95b836671245bcab0aa54ddc158efeb9e68a7c11 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Wed, 23 Aug 2023 16:37:34 -0400 Subject: [PATCH 025/209] section title added --- .../phila.gov-theme/partials/departments/v2/collection-page.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php index 238bfd22e2..9b61b2c57e 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php @@ -164,6 +164,7 @@ + From afd417b752db529f8b788148a95c7ad03769efcc Mon Sep 17 00:00:00 2001 From: derrickdso Date: Wed, 16 Nov 2022 15:31:28 -0500 Subject: [PATCH 026/209] add template admin fields --- .../class-phila-gov-admin-templates.php | 5 +-- .../admin/meta-boxes/class-phila-gov-post.php | 31 +++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php index 53aacd972a..c34e6ebd61 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php @@ -146,8 +146,9 @@ function register_template_selection_metabox_posts( $meta_boxes ){ 'required' => true, 'options' => array( 'post' => 'Post', - 'press_release' => 'Press Release', - 'action_guide' => 'Action Guide', + 'press_release' => 'Press Release', + 'advanced_post' => 'Advanced Post', + 'action_guide' => 'Action Guide', 'action_guide_2' => 'Action Guide V2' ), 'admin_columns' => array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php index 1e0a7c7e11..e70492e390 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php @@ -20,8 +20,10 @@ function register_meta_boxes_posts($meta_boxes){ 'context' => 'after_title', 'visible' => array( 'when' => array( - array('phila_template_select', '=', 'post'), + array('phila_template_select', '=', 'advanced_post'), + array('phila_template_select', '=', 'post') ), + 'relation' => 'or' ), 'fields' => array( array( @@ -191,8 +193,10 @@ function register_meta_boxes_posts($meta_boxes){ 'priority' => 'high', 'visible' => array( 'when' => array( - array('phila_template_select', '=', 'post'), + array('phila_template_select', '=', 'advanced_post'), + array('phila_template_select', '=', 'post') ), + 'relation' => 'or' ), 'fields' => array( array( @@ -363,6 +367,29 @@ function register_meta_boxes_posts($meta_boxes){ ), ); + $meta_boxes[] = array( + 'title' => 'Page content', + 'pages' => array( 'post' ), + 'priority' => 'high', + 'revision' => true, + 'visible' => array( + 'when' => array( + array('phila_template_select', '=', 'advanced_post'), + ), + ), + 'fields' => array( + array( + 'id' => 'phila_tabbed_content', + 'type' => 'group', + 'clone' => true, + 'sort_clone' => true, + 'add_button' => '+ Add tab', + 'fields' => array( + ), + ) + ) + ); + return $meta_boxes; } From 101556fe72c372824b56843f3df5d24d14ff4564 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Wed, 16 Nov 2022 15:52:12 -0500 Subject: [PATCH 027/209] add FE template file --- .../phila.gov-theme/partials/posts/advanced-post-content.php | 3 +++ wp/wp-content/themes/phila.gov-theme/templates/single-post.php | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php new file mode 100644 index 0000000000..51ee7a545d --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php @@ -0,0 +1,3 @@ +
+ hey look advanced post stuff +
\ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/templates/single-post.php b/wp/wp-content/themes/phila.gov-theme/templates/single-post.php index 60d911f1ef..e3475962c1 100644 --- a/wp/wp-content/themes/phila.gov-theme/templates/single-post.php +++ b/wp/wp-content/themes/phila.gov-theme/templates/single-post.php @@ -155,6 +155,9 @@
+ + +
From 5c38b28857b2cabad50a60b79f692c5164f652cd Mon Sep 17 00:00:00 2001 From: derrickdso Date: Tue, 22 Nov 2022 14:34:12 -0500 Subject: [PATCH 028/209] advanced post roles --- .../class-phila-gov-custom-post-types.php | 42 +++++++++++++++++++ .../admin/js/admin-department-author.js | 10 +++++ 2 files changed, 52 insertions(+) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index bcb35b712b..f52e5ba45c 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -38,6 +38,7 @@ public function __construct(){ add_action( 'init', array( $this, 'create_phila_posts' ) ); add_action( 'init', array( $this, 'create_phila_news_post' ) ); add_action( 'init', array( $this, 'create_phila_press_release' ) ); + add_action( 'init', array( $this, 'create_phila_advanced_post' ) ); } @@ -65,6 +66,10 @@ function redirect_admin_pages(){ wp_redirect(admin_url('edit.php', 'http'), 301); exit; } + if($pagenow == 'edit.php' && isset($_GET['post_type']) && $_GET['post_type'] == 'advanced_post'){ + wp_redirect(admin_url('edit.php', 'http'), 301); + exit; + } } function create_phila_service_updates() { @@ -325,6 +330,43 @@ function create_phila_press_release() { ) ); } + function create_phila_advanced_post() { + register_post_type( 'advanced_post', + array( + 'labels' => array( + 'name' => __( 'Advanced Posts' ), + 'menu_name' => __( 'Advanced Posts' ), + 'singular_name' => __( 'Advanced Post' ), + 'add_new' => __( 'Add Advanced Post' ), + 'all_items' => __( 'All Advanced Posts' ), + 'add_new_item' => __( 'Add New Advanced Post' ), + 'edit_item' => __( 'Edit Advanced Post' ), + 'view_item' => __( 'View Advanced Posts' ), + 'search_items' => __( 'Search Advanced Posts' ), + 'not_found' => __( 'Advanced Post Not Found' ), + 'not_found_in_trash' => __( 'Advanced Post not found in trash' ), + ), + 'taxonomies' => array( 'category' ), + 'supports' => array( + 'editor', + 'title', + 'revisions', + 'author' + ), + 'public' => true, + 'has_archive' => true, + 'show_in_menu' => false, + 'show_in_rest' => true, + 'rest_base' => 'advanced-posts', + 'menu_icon' => 'dashicons-editor-justify', + 'hierarchical' => false, + 'rewrite' => array( + 'slug' => 'advanced-posts', + 'with_front' => false, + ), + ) + ); + } function create_phila_staff_directory() { register_post_type( 'staff_directory', array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin-department-author.js b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin-department-author.js index 0fa1b9a513..d0ed1c75c7 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin-department-author.js +++ b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin-department-author.js @@ -131,6 +131,8 @@ jQuery(document).ready(function($){ //ensure users who only have access to posts get the option preselcted for them if (!phila_WP_User.includes('secondary_press_release_editor') && !phila_WP_User.includes('secondary_press_release_contributor') && + !phila_WP_User.includes('secondary_advanced_post_editor') && + !phila_WP_User.includes('secondary_advanced_post_contributor') && !phila_WP_User.includes( 'secondary_action_guide_editor' )){ $("#phila_template_select").val('post'); } @@ -142,6 +144,14 @@ jQuery(document).ready(function($){ } }); } + + if( phila_WP_User.includes('secondary_advanced_post_editor') || phila_WP_User.includes('secondary_advanced_post_contributor') ) { + $('#phila_template_select option').each( function () { + if( $(this).val() === 'advanced_post' ){ + $(this).css('display', 'inline-block'); + } + }); + } if( phila_WP_User.includes( 'secondary_action_guide_editor' ) ) { $('#phila_template_select option').each( function () { From 7f9875557cca3abcd778a20a4d5c431ccfb0068d Mon Sep 17 00:00:00 2001 From: derrickdso Date: Wed, 30 Nov 2022 11:39:25 -0500 Subject: [PATCH 029/209] post grid in progress --- .../public/controllers/class-phila-posts.php | 16 +++-- .../phila.gov-theme/inc/breadcrumbs.php | 2 +- .../partials/errors/post-errors.php | 4 +- .../partials/posts/post-grid.php | 62 ++++++++++++++----- 4 files changed, 59 insertions(+), 25 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php index ada6535402..dd58802fdf 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php @@ -112,7 +112,7 @@ public function set_query_defaults($request){ * @param WP_REST_Request $request Current request. */ public function get_items( $request ) { - $post_type = isset( $request['post_type'] ) ? array( $request['post_type']) : array('post', 'phila_post', 'press_release', 'news_post'); + $post_type = isset( $request['post_type'] ) ? array( $request['post_type']) : array('post', 'phila_post', 'press_release', 'news_post', 'advanced_post'); $count = isset( $request['count'] ) ? $request['count'] : '40'; @@ -150,10 +150,16 @@ public function get_items( $request ) { $new_args = array( 'post_type' => array('post'), 'meta_query' => array( - array( - 'key' => 'phila_template_select', - 'value' => 'post', - 'compare' => '=', + 'relation' => 'OR', + array( + 'key' => 'phila_template_select', + 'value' => 'post', + 'compare' => '=', + ), + array( + 'key' => 'phila_template_select', + 'value' => 'advanced_post', + 'compare' => '=', ), ), ); diff --git a/wp/wp-content/themes/phila.gov-theme/inc/breadcrumbs.php b/wp/wp-content/themes/phila.gov-theme/inc/breadcrumbs.php index 29f0798075..f6b2791a4a 100644 --- a/wp/wp-content/themes/phila.gov-theme/inc/breadcrumbs.php +++ b/wp/wp-content/themes/phila.gov-theme/inc/breadcrumbs.php @@ -19,7 +19,7 @@ function phila_breadcrumbs() { echo '
  • The latest news + events
  • '; if( phila_get_selected_template( $post->ID ) == 'press_release' ) { echo '
  • Press releases
  • '; - }elseif (phila_get_selected_template( $post->ID ) == 'post'){ + }elseif (phila_get_selected_template( $post->ID ) == 'post' || phila_get_selected_template( $post->ID ) == 'advanced_post'){ echo '
  • Posts
  • '; }elseif ( phila_get_selected_template( $post->ID ) == 'action_guide' ) { echo '
  • Action guides
  • '; diff --git a/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php b/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php index 6a620f12e5..704447c6a9 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php @@ -1,6 +1,6 @@ 'desc', 'orderby' => 'post_date', 'meta_query' => array( + 'relation' => 'OR', array( 'key' => 'phila_template_select', 'value' => 'post', 'compare' => '=', - ) + ), + array( + 'key' => 'phila_template_select', + 'value' => 'advanced_post', + 'compare' => '=', + ), ), ); if ( false === ( $sticky_posts = get_transient( get_the_ID().'_sticky_posts_results' ) ) ) { $sticky_posts = new WP_Query( $sticky_args ); - set_transient( get_the_ID().'_sticky_posts_results', $sticky_posts, 1 * HOUR_IN_SECONDS ); + // set_transient( get_the_ID().'_sticky_posts_results', $sticky_posts, 1 * HOUR_IN_SECONDS ); } @@ -64,29 +70,52 @@ 'orderby' => 'post_date', 'tag__in' => array($tag), 'meta_query' => array( - 'relation' => 'AND', + 'relation' => 'OR', array( - 'key' => 'phila_template_select', - 'value' => 'post', - 'compare' => '=', + 'relation' => 'AND', + array( + 'key' => 'phila_template_select', + 'value' => 'post', + 'compare' => '=', + ), + array( + 'relation' => 'OR', + array( + 'key' => 'phila_select_language', + 'value' => 'english', + 'compare' => '=', + ), + array( + 'key' => 'phila_select_language', + 'compare' => 'NOT EXISTS' + ), + ), ), array( - 'relation' => 'OR', + 'relation' => 'AND', array( - 'key' => 'phila_select_language', - 'value' => 'english', + 'key' => 'phila_template_select', + 'value' => 'advanced_post', 'compare' => '=', ), array( - 'key' => 'phila_select_language', - 'compare' => 'NOT EXISTS' + 'relation' => 'OR', + array( + 'key' => 'phila_select_language', + 'value' => 'english', + 'compare' => '=', + ), + array( + 'key' => 'phila_select_language', + 'compare' => 'NOT EXISTS' + ), ), ), - ) + ), ); if ( false === ( $result = get_transient( get_the_ID().'_default_posts_results' ) ) ) { $result = new WP_Query( $posts_args ); - set_transient( get_the_ID().'_default_posts_results', $result, 1 * HOUR_IN_SECONDS ); + // set_transient( get_the_ID().'_default_posts_results', $result, 1 * HOUR_IN_SECONDS ); } }else{ @@ -121,18 +150,17 @@ if ( false === ( $more_posts = get_transient( get_the_ID().'_more_posts_results' ) ) ) { $more_posts = new WP_Query( $posts_args ); - set_transient( get_the_ID().'_more_posts_results', $more_posts, 1 * HOUR_IN_SECONDS ); + // set_transient( get_the_ID().'_more_posts_results', $more_posts, 1 * HOUR_IN_SECONDS ); } if ( false === ( $result = get_transient( get_the_ID().'_empty_posts_results' ) ) ) { $result = new WP_Query(); - set_transient( get_the_ID().'_empty_posts_results', $result, 1 * HOUR_IN_SECONDS ); + // set_transient( get_the_ID().'_empty_posts_results', $result, 1 * HOUR_IN_SECONDS ); } - //if sticky posts is empty, don't add it to the results array $result->posts = array_merge(isset($sticky_posts->posts) ? $sticky_posts->posts : array(), $more_posts->posts); - + } $result->post_count = count( $result->posts ); From c2298aa5c547841131db9c96c813811df77a289a Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Thu, 7 Sep 2023 16:22:36 -0400 Subject: [PATCH 030/209] fixed programs + initiatives to programs --- .../admin/class-phila-gov-admin-menu.php | 4 +--- .../class-phila-gov-cpt-programs.php | 10 +++++----- .../class-phila-gov-program-register-templates.php | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php index 1c079920e0..cfa64c3fec 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php @@ -115,9 +115,7 @@ function phila_change_page_label() { function change_admin_post_label(){ - function owner_callback() { - wp_redirect('edit-tags.php?taxonomy=category'); - } + global $menu, $submenu; $submenu['upload.php'][5][0] = 'All Media'; $submenu['upload.php'][10][0] = 'Add New Media'; diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php b/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php index f26bce32d0..af605ef5bb 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php @@ -22,15 +22,15 @@ function create_phila_programs_initiatives() { 'labels' => array( 'name' => __( 'Programs' ), 'menu_name' => __('Programs'), - 'singular_name' => __( 'Program + Initiative' ), - 'add_new' => __( 'Add a Program or Initiative' ), + 'singular_name' => __( 'Program ' ), + 'add_new' => __( 'Add a Program' ), 'all_items' => __( 'All Programs' ), 'add_new_item' => __( 'Add a Page' ), 'edit_item' => __( 'Edit a Page' ), 'view_item' => __( 'View a Page' ), - 'search_items' => __( 'Search Programs + Initiatives Pages' ), - 'not_found' => __( 'No Programs + Initiatives Found' ), - 'not_found_in_trash' => __( 'Program + Initiative Page not found in trash' ), + 'search_items' => __( 'Search Programs Pages' ), + 'not_found' => __( 'No Programs Found' ), + 'not_found_in_trash' => __( 'Program Page not found in trash' ), ), 'taxonomies' => array('category'), 'supports' => array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-program-register-templates.php b/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-program-register-templates.php index b55bec4419..35608a245e 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-program-register-templates.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-program-register-templates.php @@ -98,7 +98,7 @@ function register_template_selection_metabox_programs( $meta_boxes ){ 'name' => 'Program hero image', 'type' => 'image_advanced', 'max_file_uploads' => 1, - 'desc' => 'Minimum size 700px by 500px. Used on the Programs + initiatives landing page and hero header.', + 'desc' => 'Minimum size 700px by 500px. Used on the Programs landing page and hero header.', 'columns' => 3, ), array( From bac3c30320cc6842876c5f2b33fefbf78e603d07 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Wed, 13 Sep 2023 15:26:07 -0400 Subject: [PATCH 031/209] created a lists component for adv blog posts --- .gitignore | 1 + .../admin/meta-boxes/class-phila-gov-post.php | 1 + .../class-phila-gov-standard-metaboxes.php | 109 ++++++++++++++++++ .../partials/posts/advanced-post-content.php | 47 +++++++- .../phila.gov-theme/templates/single-post.php | 2 +- 5 files changed, 156 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b03805065c..8320631962 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ wp/wp-content/plugins/mb-* wp/wp-content/plugins/mb-relationships wp/wp-content/plugins/two-factor-authentication-premium/ wp/wp-content/plugins/wpfront-user-role-editor/ +wp/wp-content/plugins/wpfront-user-role-editor-personal-pro/ wp/wp-content/plugins/wp-nested-pages/ wp/wp-content/plugins/meta-box-text-limiter/ wp/wp-content/plugins/disable-gutenberg/ diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php index e70492e390..4690ea230e 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php @@ -385,6 +385,7 @@ function register_meta_boxes_posts($meta_boxes){ 'sort_clone' => true, 'add_button' => '+ Add tab', 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_list_builder() ), ) ) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index d5da455c26..ac92cf1cfe 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -814,6 +814,16 @@ public static function phila_metabox_textarea( $name, $id, $desc = null, $column ); } + public static function phila_list_paragraph_textarea(){ + return array( + 'id' => 'phila_paragraph', + 'type' => 'textarea', + 'name' => 'Paragraph', + 'class' => 'percent-100', + 'required' => true + ); + } + public static function phila_metabox_url( $name, $id, $desc = null, $columns = '12', $type = 'text' ){ return array( 'name' => $name, @@ -1656,6 +1666,105 @@ public static function phila_timeline_page_selector( ){ ); } + public static function phila_list_builder() + { + return array( + 'id' => 'phila_list_builder', + 'type' => 'group', + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('Title', 'phila_list_builder_title', true, 'Enter a title for this list'), + array( + 'id' => 'phila_list_title_style', + 'type' => 'radio', + 'name' => 'Title Style', + 'required' => true, + 'options' => array( + 'h2' => 'H2', + 'h3' => 'H3', + 'h4' => 'H4', + ), + ), + array( + 'id' => 'phila_list_type', + 'type' => 'radio', + 'name' => 'List Type', + 'required' => true, + 'options' => array( + 'ordered' => 'Ordered List', + 'unordered' => 'Unordered List', + 'ordered_with_paragraph' => 'Ordered List with Paragraph', + 'unordered_with_paragraph' => 'Unordered List with Paragraph', + 'check_list' => 'Check List' + ) + ), + array( + 'id' => 'phila_ordered_list_fields', + 'type' => 'group', + 'name' => 'Ordered List', + 'clone' => true, + 'visible' => array('phila_list_type', '=', 'ordered'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_ordered_list_item', true, ''), + ), + ), + array( + 'id' => 'phila_unordered_list_fields', + 'type' => 'group', + 'name' => 'Unordered List', + 'clone' => true, + 'visible' => array('phila_list_type', '=', 'unordered'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_unordered_list_item', true, ''), + ) + ), + array( + 'id' => 'phila_ordered_with_paragraph_fields', + 'type' => 'group', + 'name' => 'Ordered List with Paragraph', + 'clone' => true, + 'visible' => array('phila_list_type', '=', 'ordered_with_paragraph'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_ordered_list_item', true, ''), + Phila_Gov_Standard_Metaboxes::phila_list_paragraph_textarea(), + ), + ), + array( + 'id' => 'phila_unordered_with_paragraph_fields', + 'type' => 'group', + 'clone' => true, + 'name' => 'Unordered List with Paragraph', + 'visible' => array('phila_list_type', '=', 'unordered_with_paragraph'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_unordered_list_item', true, ''), + Phila_Gov_Standard_Metaboxes::phila_list_paragraph_textarea(), + ), + ), + array( + 'id' => 'phila_icon_fields', + 'type' => 'group', + 'visible' => array('phila_list_type', '=', 'check_list'), + 'fields' => array( + array( + 'name' => 'Icon selection', + 'type' => 'heading' + ), + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('', 'phila_check_list_icon', false, 'Choose a Font Awesome icon. E.g.: fas fa-bell.'), + ) + ), + array( + 'id' => 'phila_check_list_fields', + 'type' => 'group', + 'name' => 'Check List', + 'clone' => true, + 'visible' => array('phila_list_type', '=', 'check_list'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_check_list_item', true, ''), + ), + ) + ) + ); + } + public static function phila_language_selector( $id = 'phila_select_language', $class = '' ){ return array( 'name' => 'Select the language of this post', diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php index 51ee7a545d..b01e32040a 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php @@ -1,3 +1,44 @@ -
    - hey look advanced post stuff -
    \ No newline at end of file + + + <>> +
      + +
    • + +
    + + + <>> +
      + +
    1. + +
    + + <>> +
      + + +
    • + +

      + +
    + + <>> +
      + +
    1. +

      + +
    + + <>> +
      + +
    • ">
    • + +
    + \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/templates/single-post.php b/wp/wp-content/themes/phila.gov-theme/templates/single-post.php index e3475962c1..46d6f35d8b 100644 --- a/wp/wp-content/themes/phila.gov-theme/templates/single-post.php +++ b/wp/wp-content/themes/phila.gov-theme/templates/single-post.php @@ -153,7 +153,7 @@ -
    +
    From 08e32f2b84277e07fd9e29aed51e040b5e25423b Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Thu, 14 Sep 2023 14:42:30 -0400 Subject: [PATCH 032/209] added q&a component to adv blog posts --- .../admin/meta-boxes/class-phila-gov-post.php | 16 +- .../class-phila-gov-standard-metaboxes.php | 279 +++++++++++++----- .../partials/posts/advanced-post-content.php | 106 ++++--- 3 files changed, 269 insertions(+), 132 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php index 4690ea230e..c3f1a0748d 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php @@ -368,8 +368,9 @@ function register_meta_boxes_posts($meta_boxes){ ); $meta_boxes[] = array( + 'id' => 'phila_adv_posts', 'title' => 'Page content', - 'pages' => array( 'post' ), + 'pages' => array('post'), 'priority' => 'high', 'revision' => true, 'visible' => array( @@ -378,20 +379,9 @@ function register_meta_boxes_posts($meta_boxes){ ), ), 'fields' => array( - array( - 'id' => 'phila_tabbed_content', - 'type' => 'group', - 'clone' => true, - 'sort_clone' => true, - 'add_button' => '+ Add tab', - 'fields' => array( - Phila_Gov_Standard_Metaboxes::phila_list_builder() - ), - ) + Phila_Gov_Standard_Metaboxes::phila_metabox_row() ) ); - return $meta_boxes; } - } diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index ac92cf1cfe..6f10268a47 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -814,13 +814,14 @@ public static function phila_metabox_textarea( $name, $id, $desc = null, $column ); } - public static function phila_list_paragraph_textarea(){ + public static function phila_paragraph_textarea($name, $desc){ return array( 'id' => 'phila_paragraph', 'type' => 'textarea', - 'name' => 'Paragraph', + 'name' => $name, 'class' => 'percent-100', - 'required' => true + 'required' => true, + 'desc' => $desc, ); } @@ -1666,100 +1667,220 @@ public static function phila_timeline_page_selector( ){ ); } - public static function phila_list_builder() + public static function phila_metabox_row() { return array( - 'id' => 'phila_list_builder', - 'type' => 'group', + 'id' => 'phila_row', + 'class' => 'phila_row', + 'type' => 'group', + 'clone' => true, + 'sort_clone' => true, + 'add_button' => '+ Add row', 'fields' => array( - Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('Title', 'phila_list_builder_title', true, 'Enter a title for this list'), - array( - 'id' => 'phila_list_title_style', - 'type' => 'radio', - 'name' => 'Title Style', - 'required' => true, - 'options' => array( - 'h2' => 'H2', - 'h3' => 'H3', - 'h4' => 'H4', - ), - ), + Phila_Gov_Standard_Metaboxes::phila_adv_posts_options(), + ), + ); + } + + public static function phila_adv_posts_options() + { + return array( + 'name' => '', + 'id' => 'phila_adv_posts_options', + 'type' => 'group', + 'fields' => + array( array( - 'id' => 'phila_list_type', - 'type' => 'radio', - 'name' => 'List Type', - 'required' => true, + 'id' => 'phila_adv_posts_select_options', + 'type' => 'select', + 'desc' => 'Choose page content.', + 'class' => 'percent-100', + 'placeholder' => 'Select page content...', 'options' => array( - 'ordered' => 'Ordered List', - 'unordered' => 'Unordered List', - 'ordered_with_paragraph' => 'Ordered List with Paragraph', - 'unordered_with_paragraph' => 'Unordered List with Paragraph', - 'check_list' => 'Check List' + 'phila_lists' => 'Lists', + 'phila_qna' => 'Q&A', ) ), array( - 'id' => 'phila_ordered_list_fields', - 'type' => 'group', - 'name' => 'Ordered List', - 'clone' => true, - 'visible' => array('phila_list_type', '=', 'ordered'), - 'fields' => array( - Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_ordered_list_item', true, ''), - ), - ), - array( - 'id' => 'phila_unordered_list_fields', + 'visible' => array('phila_adv_posts_select_options', '=', 'phila_lists'), + 'id' => 'phila_adv_lists', 'type' => 'group', - 'name' => 'Unordered List', - 'clone' => true, - 'visible' => array('phila_list_type', '=', 'unordered'), 'fields' => array( - Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_unordered_list_item', true, ''), + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('Title', 'phila_list_builder_title', true, 'Enter a title for this list'), + array( + 'id' => 'phila_list_title_style', + 'type' => 'radio', + 'name' => 'Title Style', + 'required' => true, + 'options' => array( + 'h2' => 'H2', + 'h3' => 'H3', + 'h4' => 'H4', + ), + ), + array( + 'id' => 'phila_list_type', + 'type' => 'radio', + 'name' => 'List Type', + 'required' => true, + 'options' => array( + 'ordered' => 'Ordered List', + 'unordered' => 'Unordered List', + 'ordered_with_paragraph' => 'Ordered List with Paragraph', + 'unordered_with_paragraph' => 'Unordered List with Paragraph', + 'check_list' => 'Check List' + ) + ), + array( + 'id' => 'phila_ordered_list_fields', + 'type' => 'group', + 'name' => 'Ordered List', + 'clone' => true, + 'visible' => array('phila_list_type', '=', 'ordered'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_ordered_list_item', true, ''), + ), + ), + array( + 'id' => 'phila_unordered_list_fields', + 'type' => 'group', + 'name' => 'Unordered List', + 'clone' => true, + 'visible' => array('phila_list_type', '=', 'unordered'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_unordered_list_item', true, ''), + ) + ), + array( + 'id' => 'phila_ordered_with_paragraph_fields', + 'type' => 'group', + 'name' => 'Ordered List with Paragraph', + 'clone' => true, + 'visible' => array('phila_list_type', '=', 'ordered_with_paragraph'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_ordered_list_item', true, ''), + Phila_Gov_Standard_Metaboxes::phila_paragraph_textarea($name = 'Paragraph', $desc = ''), + ), + ), + array( + 'id' => 'phila_unordered_with_paragraph_fields', + 'type' => 'group', + 'clone' => true, + 'name' => 'Unordered List with Paragraph', + 'visible' => array('phila_list_type', '=', 'unordered_with_paragraph'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_unordered_list_item', true, ''), + Phila_Gov_Standard_Metaboxes::phila_paragraph_textarea($name = 'Paragraph', $desc = ''), + ), + ), + array( + 'id' => 'phila_icon_fields', + 'type' => 'group', + 'visible' => array('phila_list_type', '=', 'check_list'), + 'fields' => array( + array( + 'name' => 'Icon selection', + 'type' => 'heading' + ), + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('', 'phila_check_list_icon', false, 'Choose a Font Awesome icon. E.g.: fas fa-bell.'), + ) + ), + array( + 'id' => 'phila_check_list_fields', + 'type' => 'group', + 'name' => 'Check List', + 'clone' => true, + 'visible' => array('phila_list_type', '=', 'check_list'), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_check_list_item', true, ''), + ), + ) ) ), array( - 'id' => 'phila_ordered_with_paragraph_fields', - 'type' => 'group', - 'name' => 'Ordered List with Paragraph', - 'clone' => true, - 'visible' => array('phila_list_type', '=', 'ordered_with_paragraph'), - 'fields' => array( - Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_ordered_list_item', true, ''), - Phila_Gov_Standard_Metaboxes::phila_list_paragraph_textarea(), - ), - ), - array( - 'id' => 'phila_unordered_with_paragraph_fields', + 'visible' => array('phila_adv_posts_select_options', '=', 'phila_qna'), + 'id' => 'phila_adv_qna', 'type' => 'group', - 'clone' => true, - 'name' => 'Unordered List with Paragraph', - 'visible' => array('phila_list_type', '=', 'unordered_with_paragraph'), - 'fields' => array( - Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_unordered_list_item', true, ''), - Phila_Gov_Standard_Metaboxes::phila_list_paragraph_textarea(), - ), - ), - array( - 'id' => 'phila_icon_fields', - 'type' => 'group', - 'visible' => array('phila_list_type', '=', 'check_list'), 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('Title', 'phila_qna_title', false, 'Enter a title'), array( - 'name' => 'Icon selection', - 'type' => 'heading' + 'id' => 'phila_qna_style', + 'type' => 'radio', + 'name' => 'Q&A Style', + 'required' => true, + 'options' => array( + 'name' => 'Enter person\'s name', + 'qa' => 'Enter Q&A', + ), ), - Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('', 'phila_check_list_icon', false, 'Choose a Font Awesome icon. E.g.: fas fa-bell.'), + array( + 'id' => 'phila_qna_person_repeater', + 'type' => 'group', + 'clone' => true, + 'sort_clone' => true, + 'visible' => array( + array('phila_qna_style', '=', 'name'), + ), + + 'fields' => array( + array( + 'name' => 'Person\'s Name', + 'id' => 'phila_qna_question_person', + 'type' => 'text', + 'required' => true, + 'desc' => 'Enter a name' + ), + array( + 'name' => 'Question', + 'id' => 'phila_qna_question', + 'type' => 'text', + 'required' => true, + 'desc' => 'Enter a question' + ), + array( + 'name' => 'Person\'s Name', + 'id' => 'phila_qna_answer_person', + 'type' => 'text', + 'required' => true, + 'desc' => 'Enter a name' + ), + array( + 'name' => 'Answer', + 'id' => 'phila_qna_answer', + 'type' => 'text', + 'required' => true, + 'desc' => 'Enter an answer', + ), + ) + ), + + array( + 'id' => 'phila_qna_repeater', + 'type' => 'group', + 'clone' => true, + 'sort_clone' => true, + 'visible' => + array( + array('phila_qna_style', '=', 'qa'), + ), + 'fields' => array( + array( + 'name' => 'Question', + 'id' => 'phila_qna_question', + 'type' => 'text', + 'required' => true, + 'desc' => 'Enter a question' + ), + array( + 'name' => 'Answer', + 'id' => 'phila_qna_answer', + 'type' => 'text', + 'required' => true, + 'desc' => 'Enter an answer', + ), + ) + ) ) - ), - array( - 'id' => 'phila_check_list_fields', - 'type' => 'group', - 'name' => 'Check List', - 'clone' => true, - 'visible' => array('phila_list_type', '=', 'check_list'), - 'fields' => array( - Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('List Item', 'phila_check_list_item', true, ''), - ), ) ) ); diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php index b01e32040a..42d19fa8c2 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php @@ -1,44 +1,70 @@ - - - <>> -
      - -
    • - -
    + - <>> -
      - -
    1. - -
    - - <>> -
      - +foreach ($page_rows as $page_row) { + if ($page_row['phila_adv_posts_options']['phila_adv_posts_select_options'] == 'phila_lists') { + $list = $page_row['phila_adv_posts_options']['phila_adv_lists']; ?> + + <>> +
        + +
      • + +
      -
    • + + <>> +
        + +
      1. + +
      + + <>> +
        + -

        - -
      - - <>> -
        - -
      1. -

        - -
      - - <>> -
        - -
      • ">
      • - -
      - + +

      + +
    + + <>> +
      + +
    1. +

      + +
    + + <>> +
      + +
    • ">
    • + +
    + +

    + + +

    (Name):

    +
    +

    (Name):

    + + +

    Q:

    +
    +

    A:

    + \ No newline at end of file From 57f200963b669dc664fbceb140611373b471987b Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Fri, 15 Sep 2023 10:23:29 -0400 Subject: [PATCH 033/209] added timeline component in adv blog posts and refactored homepage_timeline.php --- .../class-phila-gov-standard-metaboxes.php | 15 +++++++++++++++ .../partials/content-phila-row.php | 2 +- .../partials/posts/advanced-post-content.php | 3 +++ .../phila.gov-theme/partials/programs/stub.php | 2 +- .../homepage_timeline.php => timeline_stub.php} | 0 .../themes/phila.gov-theme/single-programs.php | 2 +- .../templates/single-on-site-content.php | 2 +- 7 files changed, 22 insertions(+), 4 deletions(-) rename wp/wp-content/themes/phila.gov-theme/partials/{departments/v2/homepage_timeline.php => timeline_stub.php} (100%) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index 6f10268a47..fbe937d445 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1699,6 +1699,7 @@ public static function phila_adv_posts_options() 'options' => array( 'phila_lists' => 'Lists', 'phila_qna' => 'Q&A', + 'phila_timeline' => 'Timeline', ) ), array( @@ -1881,6 +1882,20 @@ public static function phila_adv_posts_options() ) ) ) + ), + array( + 'visible' => array('phila_adv_posts_select_options', '=', 'phila_timeline'), + 'id' => 'phila_adv_timeline', + 'type' => 'group', + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_timeline_page_selector(), + array( + 'name' => 'Timeline item count', + 'id' => 'homepage_timeline_item_count', + 'desc' => 'Select the number of items from the timeline to display', + 'type' => 'number' + ), + ) ) ) ); diff --git a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php index d91b6cd9fb..77e23c4f02 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php @@ -225,7 +225,7 @@ + include(locate_template('partials/timeline_stub.php')); ?> diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php index 42d19fa8c2..1daefa9fef 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php @@ -66,5 +66,8 @@ \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/programs/stub.php b/wp/wp-content/themes/phila.gov-theme/partials/programs/stub.php index 454dcf2243..bb24418eb6 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/programs/stub.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/programs/stub.php @@ -46,7 +46,7 @@ include(locate_template( 'partials/resource-list.php')); break; case 'timeline': - get_template_part( 'partials/departments/v2/homepage_timeline' ); + get_template_part('partials/timeline_stub.php'); break; } include(locate_template( 'partials/content-additional.php' ) ); diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/homepage_timeline.php b/wp/wp-content/themes/phila.gov-theme/partials/timeline_stub.php similarity index 100% rename from wp/wp-content/themes/phila.gov-theme/partials/departments/v2/homepage_timeline.php rename to wp/wp-content/themes/phila.gov-theme/partials/timeline_stub.php diff --git a/wp/wp-content/themes/phila.gov-theme/single-programs.php b/wp/wp-content/themes/phila.gov-theme/single-programs.php index 0162aa1774..b9fd51e8e1 100644 --- a/wp/wp-content/themes/phila.gov-theme/single-programs.php +++ b/wp/wp-content/themes/phila.gov-theme/single-programs.php @@ -84,7 +84,7 @@ include(locate_template('partials/departments/v2/document-finder.php')); break; case 'timeline': - get_template_part( 'partials/departments/v2/homepage_timeline' ); + get_template_part( 'partials/timeline_stub' ); break; case ('child_index'): get_template_part( 'partials/departments/v2/child', 'index' ); diff --git a/wp/wp-content/themes/phila.gov-theme/templates/single-on-site-content.php b/wp/wp-content/themes/phila.gov-theme/templates/single-on-site-content.php index 76b3d74462..d22eba2604 100644 --- a/wp/wp-content/themes/phila.gov-theme/templates/single-on-site-content.php +++ b/wp/wp-content/themes/phila.gov-theme/templates/single-on-site-content.php @@ -158,7 +158,7 @@ break; case 'timeline': - get_template_part( 'partials/departments/v2/homepage_timeline' ); + get_template_part('partials/timeline_stub.php'); break; default: From 7122cb69bac002c3b9f08cb57d5f1ffe259ab359 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Fri, 15 Sep 2023 15:37:04 -0400 Subject: [PATCH 034/209] added stepped process to adv blog posts --- .../meta-boxes/class-phila-gov-standard-metaboxes.php | 9 ++++++++- .../partials/posts/advanced-post-content.php | 8 ++++++-- .../themes/phila.gov-theme/partials/timeline_stub.php | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index fbe937d445..90dbe9b98f 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1700,6 +1700,7 @@ public static function phila_adv_posts_options() 'phila_lists' => 'Lists', 'phila_qna' => 'Q&A', 'phila_timeline' => 'Timeline', + 'phila_adv_stepped_process' => 'Stepped Procress' ) ), array( @@ -1896,7 +1897,13 @@ public static function phila_adv_posts_options() 'type' => 'number' ), ) - ) + ), + array( + 'visible' => array('phila_adv_posts_select_options', '=', 'phila_adv_stepped_process'), + 'id' => 'phila_adv_posts_stepped_process', + 'type' => 'group', + 'fields' => Phila_Gov_Row_Select_Options::phila_metabox_tabbed_stepped_content() + ) ) ); } diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php index 1daefa9fef..ec083a5791 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php @@ -66,8 +66,12 @@ \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/timeline_stub.php b/wp/wp-content/themes/phila.gov-theme/partials/timeline_stub.php index bec962ba89..78da46780f 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/timeline_stub.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/timeline_stub.php @@ -34,8 +34,8 @@ ?> -
    -
    +
    +
    From cf43d6bc6109450e1c695af4ef304af775561a45 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Wed, 27 Sep 2023 16:20:01 -0400 Subject: [PATCH 035/209] language dropdown error fixed --- .../css/scss/base/_global-nav.scss | 24 ------------------- .../phila.gov-theme/js/dev/translations.js | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss index 3d4db8d2a4..da581063e9 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss @@ -295,30 +295,6 @@ } #translations-menu { - //hidden languages in dropdown menu - #translate-haitian-creole-dropdown { - display: none; - } - - #translate-french-dropdown { - display: none; - } - - #translate-swahili-dropdown { - display: none; - } - - #translate-portuguese-dropdown { - display: none; - } - - #translate-russian-dropdown { - display: none; - } - - #translate-vietnamese-dropdown { - display: none; - } #translations-support>a { font-weight: bold; diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js b/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js index e6c9adcbc0..74d9534a7f 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js @@ -48,6 +48,12 @@ module.exports = $(function () { $("#translate-chinese").text("中文"); $("#translate-chinese-dropdown").text("中文"); $("#translate-arabic-dropdown").text("عربي"); + $("#translate-haitian-creole-dropdown").text("Ayisyen"); + $("#translate-french-dropdown").text("Français"); + $("#translate-swahili-dropdown").text("Kiswahili"); + $("#translate-portuguese-dropdown").text("Português"); + $("#translate-russian-dropdown").text("русский"); + $("#translate-vietnamese-dropdown").text("Tiếng Việt"); function setOverflowHidden() { @@ -145,6 +151,24 @@ module.exports = $(function () { case "es": urlLanguage = "Español"; break; + case "ht": + urlLanguage = "Ayisyen"; + break; + case "fr": + urlLanguage = "Français"; + break; + case "sw": + urlLanguage = "Kiswahili"; + break; + case "pt": + urlLanguage = "Português"; + break; + case "ru": + urlLanguage = "русский"; + break; + case "vi": + urlLanguage = "Tiếng Việt"; + break; default: urlLanguage = "English"; } From df5b7fe87e1334baab10a2b08b6b67295e4176da Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Wed, 27 Sep 2023 16:30:25 -0400 Subject: [PATCH 036/209] indentation fixed --- wp/wp-content/themes/phila.gov-theme/js/dev/translations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js b/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js index 74d9534a7f..35914d36c2 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js @@ -166,7 +166,7 @@ module.exports = $(function () { case "ru": urlLanguage = "русский"; break; - case "vi": + case "vi": urlLanguage = "Tiếng Việt"; break; default: From caf0803a16ec2896daec3fed219f1d15ae4881bd Mon Sep 17 00:00:00 2001 From: derrickdso Date: Mon, 16 Oct 2023 15:49:32 -0400 Subject: [PATCH 037/209] extend local storage to other langs --- .../themes/phila.gov-theme/functions.php | 2 +- .../phila.gov-theme/js/dev/local-storage.js | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index eee1230425..a1342dcf79 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -2200,7 +2200,7 @@ function force_type_private($post, $postarr) { function set_environment() { global $phila_environment; - if (isset($_SERVER['HTTP_HOST'])) { + if (isset($_SERVER['HTTP_HOST'])) { if(strpos($_SERVER['HTTP_HOST'],'staging') !== false) { $phila_environment = 'staging'; diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/local-storage.js b/wp/wp-content/themes/phila.gov-theme/js/dev/local-storage.js index f2db5a5d24..0fc5ec3d8b 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/local-storage.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/local-storage.js @@ -57,6 +57,49 @@ module.exports = $(function(){ english:'Chinese', native:'中文' } + case 'ar': + case 'ara': + return { + english:'Arabic', + native:'عربي' + } + case 'ht': + case 'hat': + return { + english:'Haitian Creole', + native:'Ayisyen' + } + case 'fr': + case 'fre': + case 'fra': + return { + english:'French', + native:'Français' + } + case 'sw': + case 'swa': + return { + english:'Swahili', + native:'Kiswahili' + } + case 'pt': + case 'por': + return { + english:'Portuguese', + native:'Português' + } + case 'ru': + case 'rus': + return { + english:'Russian', + native:'русский' + } + case 'vi': + case 'vie': + return { + english:'Vietnamese', + native:'Tiếng Việt' + } default: return { english:'English', From f167c49bf633a8d86484c004df06efe67e51fd8b Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Wed, 18 Oct 2023 15:37:56 -0400 Subject: [PATCH 038/209] updated changes --- .../admin/admin-documentation.php | 8 +-- .../admin/class-phila-gov-admin-menu.php | 65 +++++++++++++++---- .../admin/css/admin.css | 5 ++ .../admin/js/admin-department-author.js | 4 +- .../themes/phila.gov-theme/functions.php | 9 ++- 5 files changed, 70 insertions(+), 21 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/admin-documentation.php b/wp/wp-content/plugins/phila.gov-customization/admin/admin-documentation.php index f12ce79418..c49086abff 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/admin-documentation.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/admin-documentation.php @@ -10,12 +10,6 @@ function phila_resource_hub_page() function phila_resource_hub_content() { ?> -

    Resource hub

    The following resources may be useful as you create and manage content on phila.gov.

    Resources for site editors

    @@ -24,7 +18,7 @@ function phila_resource_hub_content()

    Training presentations, guidance, and tip sheets

    This is a collection of training presentations and other guidance produced by the Digital Services team. It also includes:

    -
      +
      • Documentation for various WordPress features.

      • Links to City stock photos and other imagery sources for blogs.

        diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php index cfa64c3fec..ceee902185 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php @@ -31,6 +31,9 @@ public function __construct(){ 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') ); + } @@ -42,36 +45,36 @@ function admin_menu_order( $menu_ord ) { return array( 'index.php', 'resource-hub', - 'separator1', + 'separator-1', 'edit.php', 'edit.php?post_type=service_page', 'edit.php?post_type=programs', 'edit.php?post_type=department_page', 'edit.php?post_type=document', - 'separator2', + 'separator-2', 'edit.php?post_type=event_spotlight', 'edit.php?post_type=guides', 'edit.php?post_type=longform_content', - 'nestedpages', - 'separator3', + 'edit.php?post_type=page', + 'separator-3', 'edit.php?post_type=staff_directory', 'upload.php', 'edit.php?post_type=calendar', 'edit.php?post_type=text-blocks', 'edit.php?post_type=service_updates', 'edit.php?post_type=site_wide_alert', - 'separator4', + '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', - 'separator5', + 'separator-5', 'themes.php', 'phila_gov', 'options-general.php', - 'separator-last', + 'separator-6', 'tools.php', 'plugins.php', ); @@ -113,15 +116,55 @@ function phila_change_page_label() { $labels->name_admin_bar = 'Top-Level Pages'; } + function add_custom_menu_separator() + { + global $menu; + $separator_index = array(4, 59, 99); + + 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; + global $submenu; $submenu['upload.php'][5][0] = 'All Media'; $submenu['upload.php'][10][0] = 'Add New Media'; - $menu[997] = ['', 'read', 'separator3', '', 'wp-menu-separator']; - $menu[998] = ['', 'read', 'separator4', '', 'wp-menu-separator']; - $menu[999] = ['', 'read', 'separator5', '', 'wp-menu-separator']; // 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'); diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/css/admin.css b/wp/wp-content/plugins/phila.gov-customization/admin/css/admin.css index 4d765adfb9..8bb05f13fe 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/css/admin.css +++ b/wp/wp-content/plugins/phila.gov-customization/admin/css/admin.css @@ -189,6 +189,11 @@ ul#department_page-search-checklist li{ width: 75%; } +.resource-hub{ + list-style: disc; + margin-left: 2em; +} + #newpost_tag_parent, #addtag .form-field.term-parent-wrap { display: none; diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin-department-author.js b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin-department-author.js index 0fa1b9a513..1946e38ef1 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin-department-author.js +++ b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin-department-author.js @@ -42,8 +42,8 @@ jQuery(document).ready(function($){ } //Hide all category and tag menu items, department authors shouldn't see those. - $('a[href*="edit-tags.php"]').parent().css('display', 'none'); - +$('a[href="edit-tags.php?taxonomy=category&post_type=calendar"]').parent().css("display", "none"); + var menuIdString = $('#menu-id').text().trim(); var allMenuIDs = menuIdString.split(' '); var match = document.getElementById( allMenuIDs ); diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index f91a5f849e..45e83c047e 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -140,8 +140,15 @@ function phila_content_image_sizes_attr( $sizes, $size ) { return $sizes; } +add_action('admin_head', 'bg_separator'); - +function bg_separator() { + echo ''; +} add_filter('pre_get_document_title', 'phila_filter_title'); From 3c41a2a22516a23f3162ccabfadc0a55cb933925 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Wed, 18 Oct 2023 16:08:17 -0400 Subject: [PATCH 039/209] moved custom css from functions to admin.css --- .../phila.gov-customization/admin/css/admin.css | 6 +++++- wp/wp-content/themes/phila.gov-theme/functions.php | 10 ---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/css/admin.css b/wp/wp-content/plugins/phila.gov-customization/admin/css/admin.css index 8bb05f13fe..7cafde25ab 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/css/admin.css +++ b/wp/wp-content/plugins/phila.gov-customization/admin/css/admin.css @@ -216,4 +216,8 @@ ul#department_page-search-checklist li{ /* Override rwmb-columns attempt to make all fields width: 100% */ .rwmb-column .rwmb-input input:not([type="checkbox"]):not([type="radio"]), .rwmb-column .rwmb-input-group, .rwmb-column .rwmb-input select, .rwmb-column .rwmb-input .select2-container { width: auto !important; -} \ No newline at end of file +} + +#adminmenu div.separator{ + background-color: rgba(240,246,252,.6); + } \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index 45e83c047e..28fdf370f5 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -140,16 +140,6 @@ function phila_content_image_sizes_attr( $sizes, $size ) { return $sizes; } -add_action('admin_head', 'bg_separator'); - -function bg_separator() { - echo ''; -} - add_filter('pre_get_document_title', 'phila_filter_title'); function phila_filter_title( $title ){ From eb7b4a7481ff54402e406da4af89ff34e3357158 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Tue, 24 Oct 2023 13:11:55 -0400 Subject: [PATCH 040/209] added image gallery to adv blog posts --- .../class-phila-gov-standard-metaboxes.php | 41 +++++++- .../themes/phila.gov-theme/css/scss/base.scss | 1 + .../css/scss/pages/_advanced-posts.scss | 95 +++++++++++++++++++ .../phila.gov-theme/js/dev/advanced-posts.js | 46 +++++++++ .../themes/phila.gov-theme/js/dev/main.js | 1 + .../partials/content-one-quarter-simple.php | 1 - .../partials/errors/post-errors.php | 18 +++- .../partials/phila_blog_adv_image_gallery.php | 42 ++++++++ .../partials/phila_blog_adv_lists.php | 46 +++++++++ .../partials/phila_blog_adv_qa.php | 26 +++++ .../partials/posts/advanced-post-content.php | 70 ++------------ 11 files changed, 321 insertions(+), 66 deletions(-) create mode 100644 wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss create mode 100644 wp/wp-content/themes/phila.gov-theme/js/dev/advanced-posts.js create mode 100644 wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php create mode 100644 wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php create mode 100644 wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index 90dbe9b98f..4f1477aa40 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1700,7 +1700,8 @@ public static function phila_adv_posts_options() 'phila_lists' => 'Lists', 'phila_qna' => 'Q&A', 'phila_timeline' => 'Timeline', - 'phila_adv_stepped_process' => 'Stepped Procress' + 'phila_adv_stepped_process' => 'Stepped Procress', + 'phila_image_gallery' => 'Image Gallery' ) ), array( @@ -1898,12 +1899,48 @@ public static function phila_adv_posts_options() ), ) ), - array( + array( 'visible' => array('phila_adv_posts_select_options', '=', 'phila_adv_stepped_process'), 'id' => 'phila_adv_posts_stepped_process', 'type' => 'group', 'fields' => Phila_Gov_Row_Select_Options::phila_metabox_tabbed_stepped_content() + ), + array( + 'visible' => array('phila_adv_posts_select_options', '=', 'phila_image_gallery'), + 'id' => 'phila_adv_posts_image_gallery', + 'type' => 'group', + 'fields' => array( + array( + 'id' => 'phila_image_gallery_details', + 'type' => 'group', + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_text('Title', 'phila_image_gallery_title', true, 'Enter a title for this image gallery'), + array( + 'name' => 'Description', + 'id' => 'phila_image_gallery_description', + 'type' => 'wysiwyg', + 'options' => Phila_Gov_Standard_Metaboxes::phila_wysiwyg_options_basic() + ) + ) + ), + array( + 'type' => 'group', + 'id' => 'phila_image_gallery', + 'min_clone' => 3, + 'max_clone' => 10, + 'clone' => true, + 'sort_clone' => true, + 'fields' => array( + array( + 'id' => 'phila_images', + 'name' => 'Select image', + 'type' => 'image_advanced', + 'max_file_uploads' => 1, + ) + ) + ) ) + ) ) ); } diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss index befc7798a0..7b8b1ed723 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss @@ -51,6 +51,7 @@ @import 'modules/stage-tracker'; @import 'pages/action-guide-v2'; +@import 'pages/advanced-posts'; @import 'pages/collection-page'; @import 'pages/departments'; @import 'pages/documents'; diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss new file mode 100644 index 0000000000..d4dcbe241e --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss @@ -0,0 +1,95 @@ +.slideshow-container { + width: 100%; + height: 540px; + position: relative; + margin-bottom: 100px; + + .mySlides { + display: none; + &.active{ + display: block; + } + } + + img { + vertical-align: middle; + width: 100%; + height: 540px; + object-fit: cover; + } + + .prev, + .next { + position: absolute; + top: 50%; + border-radius: 100%; + margin-left: 16px; + margin-right: 16px; + } + + .next { + right: 0; + } + + .prev { + left: 0; + } + + .image-gallery-arrows { + border-radius: 100%; + padding: 5px; + font-size: 25px; + background: white; + color: black; + mix-blend-mode: screen; + } + + .image-gallery-arrows:hover { + background: #444444; + color: white; + mix-blend-mode: multiply; + } + + .text { + font-style: italic; + font-weight: 700; + color: #444444; + line-height: 25px; + padding: 16px 25px; + width: 100%; + background-color: #f0f0f0; + position: absolute; + top: 100%; + z-index: 1; + } + + .dots { + width: 100%; + height: 50px; + padding: 2px 2px 2px 2px; + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + position: absolute; + bottom: 0.1px; + background-color: rgba(0, 0, 0, 0.3); + } + + .dot { + height: 15px; + width: 15px; + background-color: #ffffff; + border-radius: 50%; + display: inline-block; + margin-right: 10px; + margin-left: 10px; + &.active { + color: #000000; + height: 20px; + width: 20px; + } + } + + +} \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/advanced-posts.js b/wp/wp-content/themes/phila.gov-theme/js/dev/advanced-posts.js new file mode 100644 index 0000000000..0f3a3063f7 --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/advanced-posts.js @@ -0,0 +1,46 @@ +module.exports = $(function () { + function showSlides2() { + var containers = $(".slideshow-container"); + + containers.each(function () { + var container = $(this); + var slides = container.find(".mySlides"); + var dots = container.find(".dots .dot"); + + var currentIndex = 0; + + function showSlide(index) { + slides.eq(currentIndex).removeClass("active"); + currentIndex = index; + slides.eq(currentIndex).addClass("active"); + } + + container.find(".next").click(function () { + var nextIndex = (currentIndex + 1) % slides.length; + showSlide(nextIndex); + updateDot(nextIndex); + }); + + container.find(".prev").click(function () { + var prevIndex = (currentIndex - 1 + slides.length) % slides.length; + showSlide(prevIndex); + updateDot(prevIndex); + }); + + dots.click(function () { + var dotIndex = dots.index(this); + showSlide(dotIndex); + updateDot(dotIndex); + }); + + function updateDot(index) { + dots.removeClass("active"); + dots.eq(index).addClass("active"); + } + }); + } + + $(document).ready(function () { + showSlides2(); + }); +}); diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/main.js b/wp/wp-content/themes/phila.gov-theme/js/dev/main.js index 3dd63fc50d..df81dadd7b 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/main.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/main.js @@ -4,6 +4,7 @@ require('phila-standards') require('./phila-gov') require('./action-guide-v2'); +require('./advanced-posts'); require('./chevrons'); require('./city-directory-list') require('./collapsible-div') diff --git a/wp/wp-content/themes/phila.gov-theme/partials/content-one-quarter-simple.php b/wp/wp-content/themes/phila.gov-theme/partials/content-one-quarter-simple.php index 70f9c549ff..6300a2e5e1 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/content-one-quarter-simple.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/content-one-quarter-simple.php @@ -15,7 +15,6 @@
    -

    \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php b/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php index d23254c99f..e682e06b57 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php @@ -1,5 +1,5 @@ "Warning: The number of images in image gallery doesn't meet the requirements", + 'link' => '', + 'messages' => array( + '

    The image gallery of a blog post must have a minimum of 3 images

    ' + ) + ); + } + } + } + } diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php new file mode 100644 index 0000000000..d37406fabc --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php @@ -0,0 +1,42 @@ + +

    +

    +
    + $image) { + $media_credit = get_post_meta($image['phila_images'][0])['phila_media_credit'][0]; + $media_caption = get_post($image['phila_images'][0])->post_excerpt; + ?> + +
    "> + + + + +
    + + Photo by: +
    + + + + +
    + +
    + +
    + + + +
    +
    \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php new file mode 100644 index 0000000000..b99df5ed4b --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php @@ -0,0 +1,46 @@ + + <>> +
      + +
    • + +
    + + + <>> +
      + +
    1. + +
    + + <>> +
      + + +
    • + +

      + +
    + + <>> +
      + +
    1. +

      + +
    + + <>> +
      + +
    • ">
    • + +
    + \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php new file mode 100644 index 0000000000..6f4c4f3217 --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php @@ -0,0 +1,26 @@ + +

    + + +

    (Name):

    +
    +

    (Name):

    + + +

    Q:

    +
    +

    A:

    + \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php index ec083a5791..2ed4542dcf 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php @@ -2,70 +2,11 @@ foreach ($page_rows as $page_row) { if ($page_row['phila_adv_posts_options']['phila_adv_posts_select_options'] == 'phila_lists') { - $list = $page_row['phila_adv_posts_options']['phila_adv_lists']; ?> - - <>> -
      - -
    • - -
    - - - <>> -
      - -
    1. - -
    - - <>> -
      - - -
    • - -

      - -
    - - <>> -
      - -
    1. -

      - -
    - - <>> -
      - -
    • ">
    • - -
    - -

    - - -

    (Name):

    -
    -

    (Name):

    - - -

    Q:

    -
    -

    A:

    - \ No newline at end of file From fdad381dc5168d15743984774513c4540a2f444e Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Tue, 24 Oct 2023 15:38:16 -0400 Subject: [PATCH 041/209] fixed the post picker to pick posts/advanced posts according to selected option --- .../templates/class-phila-gov-collection-page.php | 4 ++-- .../class-phila-gov-standard-metaboxes.php | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php b/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php index 8d7cfb076c..da74d89679 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/departments/templates/class-phila-gov-collection-page.php @@ -108,7 +108,7 @@ function register_collection_page_metaboxes( $meta_boxes ){ ), 'fields' => array( Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_wysiwyg_title( $name = '1/4 heading'), - Phila_Gov_Standard_Metaboxes::phila_post_selector( $multiple = true ), + Phila_Gov_Standard_Metaboxes::phila_post_selector( $multiple = true, $post_types = ['post', 'advanced_post'] ), array( 'id' => 'phila_v2_posts_link', 'title' => 'See all posts', @@ -129,7 +129,7 @@ function register_collection_page_metaboxes( $meta_boxes ){ ), 'fields' => array( Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_wysiwyg_title($name = '1/4 heading'), - Phila_Gov_Standard_Metaboxes::phila_post_selector( $multiple = true ), + Phila_Gov_Standard_Metaboxes::phila_post_selector( $multiple = true, $post_types = ['press_release'] ), array( 'id' => 'phila_v2_press_release_link', 'title' => 'See all press releases', diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index 4f1477aa40..92a607fbb7 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -620,7 +620,18 @@ public static function phila_v2_service_page_selector( $multiple = false ){ ); } - public static function phila_post_selector( $multiple = false ){ + public static function phila_post_selector( $multiple = false, $post_types = []){ + $meta_query = array( + 'relation' => 'OR', + ); + + foreach ($post_types as $post_type) { + $meta_query[] = array( + 'key' => 'phila_template_select', + 'value' => $post_type, + 'compare' => '=', + ); + } return array( 'id' => 'phila_post_picker', 'name' => 'Select posts (3 total)', @@ -631,6 +642,7 @@ public static function phila_post_selector( $multiple = false ){ 'post_status' => 'any', 'orderby' => 'title', 'order' => 'ASC', + 'meta_query' => $meta_query ), 'multiple' => $multiple, 'placeholder' => ' ', From c67298b7f9675242a9cbb528222b1d65638efe72 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Mon, 30 Oct 2023 15:59:32 -0400 Subject: [PATCH 042/209] made changes to lightbox and added tab nav --- .../class-phila-gov-standard-metaboxes.php | 2 ++ .../css/scss/pages/_advanced-posts.scss | 19 ++++++++---- .../phila.gov-theme/js/dev/advanced-posts.js | 31 +++++++++++++++++-- .../partials/errors/post-errors.php | 2 +- .../partials/phila_blog_adv_image_gallery.php | 19 ++++++------ .../partials/phila_blog_adv_lists.php | 14 +++++++-- .../partials/phila_blog_adv_qa.php | 3 ++ 7 files changed, 70 insertions(+), 20 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index 92a607fbb7..8663ef932c 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1930,6 +1930,7 @@ public static function phila_adv_posts_options() array( 'name' => 'Description', 'id' => 'phila_image_gallery_description', + 'desc' => 'Enter a description for this image gallery', 'type' => 'wysiwyg', 'options' => Phila_Gov_Standard_Metaboxes::phila_wysiwyg_options_basic() ) @@ -1942,6 +1943,7 @@ public static function phila_adv_posts_options() 'max_clone' => 10, 'clone' => true, 'sort_clone' => true, + 'add_button' => '+ Add an image', 'fields' => array( array( 'id' => 'phila_images', diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss index d4dcbe241e..3d8b5d55ef 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss @@ -20,6 +20,7 @@ .prev, .next { + background: none; position: absolute; top: 50%; border-radius: 100%; @@ -75,7 +76,11 @@ bottom: 0.1px; background-color: rgba(0, 0, 0, 0.3); } - + + button{ + background: none; + } + .dot { height: 15px; width: 15px; @@ -83,13 +88,15 @@ border-radius: 50%; display: inline-block; margin-right: 10px; - margin-left: 10px; + margin-left: 10px; &.active { - color: #000000; - height: 20px; - width: 20px; + height: 20px; + width: 20px; } + } + + .dot:hover{ + background-color: #959595; } - } \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/advanced-posts.js b/wp/wp-content/themes/phila.gov-theme/js/dev/advanced-posts.js index 0f3a3063f7..813a139ad3 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/advanced-posts.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/advanced-posts.js @@ -1,5 +1,5 @@ module.exports = $(function () { - function showSlides2() { + function showSlides() { var containers = $(".slideshow-container"); containers.each(function () { @@ -40,7 +40,34 @@ module.exports = $(function () { }); } + $('.lightbox-link').click(function() { + var imageId = $(this).data('open'); + var closeButton = ""; + $("#"+imageId).on("open.zf.reveal", function (e) { + var $modal = $(this); + $modal.html("Loading..."); + var imageUrl = $modal.data("image-url"); + var imageCaption = $modal.data("media-caption"); + var imageCredit = $modal.data("media-credit"); + + $modal.html(''); + + if (imageCredit) { + var featuredCredit = document.createElement("p"); + featuredCredit.innerHTML = + "Photo by: " + imageCredit + ""; + $modal.append(featuredCredit); + } + if (imageCaption) { + var featuredCaption = document.createElement("p"); + featuredCaption.innerHTML = imageCaption; + $modal.append(featuredCaption); + } + $modal.append(closeButton); + }); + }); + $(document).ready(function () { - showSlides2(); + showSlides(); }); }); diff --git a/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php b/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php index e682e06b57..baa229a21c 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/errors/post-errors.php @@ -46,7 +46,7 @@ $page_rows = rwmb_meta('phila_row'); foreach ($page_rows as $page_row) { if ($page_row['phila_adv_posts_options']['phila_adv_posts_select_options'] == 'phila_image_gallery') { - if(count($page_row['phila_adv_posts_options']['phila_adv_posts_image_gallery']) < 3){ + if(count($page_row['phila_adv_posts_options']['phila_adv_posts_image_gallery']['phila_image_gallery']) < 3){ $error_messages[] = array( 'title' => "Warning: The number of images in image gallery doesn't meet the requirements", 'link' => '', diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php index d37406fabc..16af5766f7 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php @@ -3,19 +3,20 @@ Partial for Advanced Blog Posts Image Gallery Component */ ?> +

    - $image) { + $image) { $media_credit = get_post_meta($image['phila_images'][0])['phila_media_credit'][0]; $media_caption = get_post($image['phila_images'][0])->post_excerpt; - ?> - + $image_url = wp_get_attachment_url($image['phila_images'][0]); + $image_key = $image['phila_images'][0] + $key; ?>
    "> - - - + +
    + +
    @@ -34,9 +35,9 @@ for ($i = 0; $i < count($images); $i++) { $isActive = ($i === 0) ? 'active' : ''; ?> - +
    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php index b99df5ed4b..d282e4f9f8 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php @@ -2,23 +2,28 @@ /* Partial for Advanced Blog Posts Lists Component */ +?> -if ($list['phila_list_type'] == "unordered") { ?> + +
    <>>
    - +
    +
    <>>
    +
    +
    <>>
      @@ -28,7 +33,9 @@

    +
    +
    <>>
      @@ -36,11 +43,14 @@

    +
    +
    <>>
    • ">
    +
    \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php index 6f4c4f3217..4512386956 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php @@ -5,6 +5,7 @@ if ($qna['phila_qna_title'] != "") { ?> +

    (Name):

    (Name):

    +
    @@ -20,6 +22,7 @@

    Q:

    A:

    +
    Date: Tue, 31 Oct 2023 14:23:48 -0400 Subject: [PATCH 043/209] code clean up --- .../partials/phila_blog_adv_image_gallery.php | 77 ++++++++++--------- .../partials/phila_blog_adv_lists.php | 14 +--- .../partials/phila_blog_adv_qa.php | 42 +++++----- 3 files changed, 64 insertions(+), 69 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php index 16af5766f7..dc285cc86d 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php @@ -3,41 +3,44 @@ Partial for Advanced Blog Posts Image Gallery Component */ ?> -
    -

    -

    -
    - $image) { - $media_credit = get_post_meta($image['phila_images'][0])['phila_media_credit'][0]; - $media_caption = get_post($image['phila_images'][0])->post_excerpt; - $image_url = wp_get_attachment_url($image['phila_images'][0]); - $image_key = $image['phila_images'][0] + $key; ?> -
    "> - -
    - - - -
    - - Photo by: -
    - - - - -
    - +
    +

    +

    +
    + $image) { + $media_credit = get_post_meta($image['phila_images'][0])['phila_media_credit'][0]; + $media_caption = get_post($image['phila_images'][0])->post_excerpt; + $image_url = wp_get_attachment_url($image['phila_images'][0]); + $image_key = $image['phila_images'][0] + $key; ?> +
    "> + +
    + + + +
    + + Photo by: +
    + + + + +
    + +
    + +
    + + +
    - -
    - - - -
    -
    \ No newline at end of file +
    +
    \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php index d282e4f9f8..9b0e90b580 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_lists.php @@ -4,26 +4,22 @@ */ ?> +
    -
    <>>
    -
    -
    <>>
    -
    -
    <>>
      @@ -33,9 +29,7 @@

    -
    -
    <>>
      @@ -43,14 +37,12 @@

    -
    -
    <>>
    • ">
    -
    - \ No newline at end of file + +
    \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php index 4512386956..ac074c088e 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_qa.php @@ -2,28 +2,28 @@ /* Partial for Advanced Blog Posts Q&A Component */ - +?> +
    + -

    - -

    (Name):

    -
    -

    (Name):

    -
    - - -

    Q:

    -
    -

    A:

    -
    - \ No newline at end of file + if ($qna['phila_qna_style'] == 'name') { + foreach ($qna['phila_qna_person_repeater'] as $qa) { ?> + +

    (Name):

    +
    +

    (Name):

    + + +

    Q:

    +
    +

    A:

    + +
    \ No newline at end of file From 78c10e67cf3c1e180681d4c0a5d0993ffeb3e06d Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Wed, 1 Nov 2023 09:15:06 -0400 Subject: [PATCH 044/209] frontend changes --- wp/wp-content/themes/phila.gov-theme/css/scss/_lightbox.scss | 1 + .../themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss | 3 +++ .../phila.gov-theme/partials/phila_blog_adv_image_gallery.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/_lightbox.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/_lightbox.scss index 5a90fac607..9ff3086b67 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/_lightbox.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/_lightbox.scss @@ -16,6 +16,7 @@ } .reveal{ + top: 10% !important; min-height:400px; padding-bottom: 4rem; position: relative; diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss index 3d8b5d55ef..72bf180601 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss @@ -26,6 +26,7 @@ border-radius: 100%; margin-left: 16px; margin-right: 16px; + cursor: pointer; } .next { @@ -79,6 +80,8 @@ button{ background: none; + padding: 0; + border-radius: 50%; } .dot { diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php index dc285cc86d..cd19c73a3a 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila_blog_adv_image_gallery.php @@ -37,7 +37,7 @@ for ($i = 0; $i < count($images); $i++) { $isActive = ($i === 0) ? 'active' : ''; ?> - + From 9960b4d0c6fa0c6ace10d63d703edc1ef6fc796a Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Fri, 3 Nov 2023 09:51:28 -0400 Subject: [PATCH 045/209] wysiwyg added --- .../phila.gov-customization/admin/meta-boxes/meta-boxes.php | 1 + .../phila.gov-theme/partials/services/content-topic-page.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php index b786c20885..55ee7a56c5 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php @@ -891,6 +891,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'visible' => array('phila_template_select', 'topic_page'), 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_advanced_small_wysiwyg('Topic Page Content'), array( 'name' => 'Hide child pages', 'type' => 'heading' diff --git a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php index 819291b3fc..7ed2079f3a 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php @@ -8,7 +8,7 @@
    - +
    @@ -33,7 +33,7 @@

    - +
    From 8a476b1a204f11a8dc345f3da13cdaa48f9aee60 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Fri, 3 Nov 2023 14:16:48 -0400 Subject: [PATCH 046/209] wysiwyg added2 --- .../phila.gov-theme/partials/services/content-topic-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php index 7ed2079f3a..d3e6badd42 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php @@ -8,7 +8,7 @@
    - +
    From 7541f3a0178a46e28cc6730e8684c7bd3e230f76 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Wed, 8 Nov 2023 16:43:38 -0500 Subject: [PATCH 047/209] added series component to adv blog posts --- .../class-phila-gov-custom-post-types.php | 37 +++++++++++++++++++ .../class-phila-gov-admin-templates.php | 1 + .../admin/meta-boxes/class-phila-gov-post.php | 17 +++++++++ .../class-phila-gov-standard-metaboxes.php | 28 +++++++++++++- .../phila.gov-theme/css/scss/_card.scss | 6 +++ .../css/scss/pages/_advanced-posts.scss | 14 +++++++ .../partials/phila-series-block.php | 21 +++++++++++ .../partials/posts/advanced-post-content.php | 3 ++ .../partials/posts/phila-series.php | 35 ++++++++++++++++++ .../phila.gov-theme/templates/single-post.php | 3 ++ 10 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 wp/wp-content/themes/phila.gov-theme/partials/phila-series-block.php create mode 100644 wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index f52e5ba45c..884926767e 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -367,6 +367,43 @@ function create_phila_advanced_post() { ) ); } + function create_phila_series() { + register_post_type( 'series', + array( + 'labels' => array( + 'name' => __( 'Series' ), + 'menu_name' => __( 'Series' ), + 'singular_name' => __( 'Series' ), + 'add_new' => __( 'Add Series' ), + 'all_items' => __( 'All Series' ), + 'add_new_item' => __( 'Add New Series' ), + 'edit_item' => __( 'Edit Series' ), + 'view_item' => __( 'View Series' ), + 'search_items' => __( 'Search Series' ), + 'not_found' => __( 'Series Not Found' ), + 'not_found_in_trash' => __( 'Series not found in trash' ), + ), + 'taxonomies' => array( 'category' ), + 'supports' => array( + 'editor', + 'title', + 'revisions', + 'author' + ), + 'public' => true, + 'has_archive' => true, + 'show_in_menu' => false, + 'show_in_rest' => true, + 'rest_base' => 'series', + 'menu_icon' => 'dashicons-editor-justify', + 'hierarchical' => false, + 'rewrite' => array( + 'slug' => 'series', + 'with_front' => false, + ), + ) + ); + } function create_phila_staff_directory() { register_post_type( 'staff_directory', array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php index c34e6ebd61..ef6c0e6a83 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php @@ -148,6 +148,7 @@ function register_template_selection_metabox_posts( $meta_boxes ){ 'post' => 'Post', 'press_release' => 'Press Release', 'advanced_post' => 'Advanced Post', + 'series' => 'Series', 'action_guide' => 'Action Guide', 'action_guide_2' => 'Action Guide V2' ), diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php index c3f1a0748d..f8f80e61be 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php @@ -382,6 +382,23 @@ function register_meta_boxes_posts($meta_boxes){ Phila_Gov_Standard_Metaboxes::phila_metabox_row() ) ); + + $meta_boxes[] = array( + 'id' => 'phila_adv_series', + 'title' => 'Series content', + 'priority' => 'high', + 'pages' => array('post'), + 'revision' => true, + 'visible' => array( + 'when' => array( + array('phila_template_select', '=', 'series'), + ), + ), + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_series_row() + ) + ); + return $meta_boxes; } } diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index 8663ef932c..0f48d3123c 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1694,6 +1694,23 @@ public static function phila_metabox_row() ); } + public static function phila_series_row() + { + return array( + 'id' => 'phila_adv_series_content', + 'type' => 'group', + 'fields' => array( + array( + 'id' => 'series_linking_text', + 'name' => 'Series linking text', + 'type' => 'text', + ), + Phila_Gov_Standard_Metaboxes::phila_post_selector($multiple = true, $post_types = ['post', 'advanced_post']), + ), + ); + } + + public static function phila_adv_posts_options() { return array( @@ -1713,7 +1730,8 @@ public static function phila_adv_posts_options() 'phila_qna' => 'Q&A', 'phila_timeline' => 'Timeline', 'phila_adv_stepped_process' => 'Stepped Procress', - 'phila_image_gallery' => 'Image Gallery' + 'phila_image_gallery' => 'Image Gallery', + 'phila_series' => 'Series' ) ), array( @@ -1954,6 +1972,14 @@ public static function phila_adv_posts_options() ) ) ) + ), + array( + 'visible' => array('phila_adv_posts_select_options', '=', 'phila_series'), + 'id' => 'phila_adv_series', + 'type' => 'group', + 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_post_selector($multiple = false, $post_types = ['series']), + ), ) ) ); diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/_card.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/_card.scss index e4c16afb0c..a3cabadd1d 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/_card.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/_card.scss @@ -75,6 +75,12 @@ a.card, border-bottom:5px solid map-get($post_content_types, action_guide); } } + &.card--series{ + min-height:24rem; + &:not(.card--last){ + border-bottom:5px solid #9400c6; + } + } &.card--press_release{ h1{ font-size: rem-calc(16); diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss index 72bf180601..7fb91d7c39 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_advanced-posts.scss @@ -102,4 +102,18 @@ background-color: #959595; } +} + +.series{ + margin-bottom: 95px; + .card{ + width: 299px; + } + .series-img{ + width: 299px !important; + height: 209px !important; + } + h1{ + font-size: 20px; + } } \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila-series-block.php b/wp/wp-content/themes/phila.gov-theme/partials/phila-series-block.php new file mode 100644 index 0000000000..9666cfae95 --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/partials/phila-series-block.php @@ -0,0 +1,21 @@ + + + + + \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php index 2ed4542dcf..c8ec36df91 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php @@ -19,5 +19,8 @@ $title = $page_row['phila_adv_posts_options']['phila_adv_posts_image_gallery']['phila_image_gallery_details']['phila_image_gallery_title']; $description = $page_row['phila_adv_posts_options']['phila_adv_posts_image_gallery']['phila_image_gallery_details']['phila_image_gallery_description']; include(locate_template('partials/phila_blog_adv_image_gallery.php')); + } elseif ($page_row['phila_adv_posts_options']['phila_adv_posts_select_options'] == 'phila_series') { + $series = $page_row['phila_adv_posts_options']['phila_adv_series']; + include(locate_template('partials/phila-series-block.php')); } } ?> \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php new file mode 100644 index 0000000000..73d89b45ff --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php @@ -0,0 +1,35 @@ + +
    + post_type; + ?> + + +
    \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/templates/single-post.php b/wp/wp-content/themes/phila.gov-theme/templates/single-post.php index 46d6f35d8b..a2a1f53350 100644 --- a/wp/wp-content/themes/phila.gov-theme/templates/single-post.php +++ b/wp/wp-content/themes/phila.gov-theme/templates/single-post.php @@ -158,6 +158,9 @@ + + +
    From f566e6d3e4832cdc602c08577773d9d9ac436865 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Fri, 10 Nov 2023 12:52:03 -0500 Subject: [PATCH 048/209] topic page wysiwyg fix1 --- .../phila.gov-theme/partials/services/content-topic-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php index d3e6badd42..4ca7c4b6f0 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php @@ -5,7 +5,7 @@ * */ ?> - +
    From 2eb525857c20b1e0e9aba55eb3347499b4426179 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Fri, 10 Nov 2023 13:09:57 -0500 Subject: [PATCH 049/209] topic page wysiwyg fix2 --- .../phila.gov-theme/partials/services/content-topic-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php index 4ca7c4b6f0..59147deb48 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php @@ -5,7 +5,7 @@ * */ ?> - +
    From 8eb6b3ffbfabd58a7efbc1b734c907da8e32f73c Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Mon, 11 Dec 2023 15:49:35 -0500 Subject: [PATCH 050/209] update conditional to render short description --- .../partials/services/content-topic-page.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php index 819291b3fc..4ccad25ea4 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/services/content-topic-page.php @@ -5,12 +5,18 @@ * */ ?> - +
    - +
    + +
    +
    + +
    +
    'service_page', @@ -33,7 +39,7 @@

    - +
    From cdfea8f0ac8c4dc2f6b1745f8b47657db2f534b9 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Mon, 11 Dec 2023 15:52:49 -0500 Subject: [PATCH 051/209] metabox update --- .../phila.gov-customization/admin/meta-boxes/meta-boxes.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php index b786c20885..1c5b07a094 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php @@ -891,6 +891,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'visible' => array('phila_template_select', 'topic_page'), 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_advanced_small_wysiwyg('Topic Page Content'), array( 'name' => 'Hide child pages', 'type' => 'heading' From f7b9eaf14cef5d1981a6a7603ef4460516ed48de Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Wed, 13 Dec 2023 15:32:50 -0500 Subject: [PATCH 052/209] changed menu item highlighting & added sentence case --- .../admin/class-phila-gov-admin-menu.php | 33 +++--- .../class-phila-gov-custom-post-types.php | 100 +++++++++--------- .../class-phila-gov-custom-taxonomies.php | 66 ++++++------ .../class-phila-gov-cpt-departments.php | 18 ++-- .../class-phila-gov-cpt-event-spotlight.php | 22 ++-- .../guides/class-phila-gov-cpt-guides.php | 2 +- .../phila.gov-customization/admin/js/admin.js | 37 +++++++ .../class-phila-gov-cpt-programs.php | 16 +-- .../class-phila-gov-cpt-service-page.php | 18 ++-- 9 files changed, 177 insertions(+), 135 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php index ceee902185..2316bc3fc2 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php @@ -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'; @@ -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'; @@ -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'; } @@ -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'); @@ -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' ); diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index 23b10d5424..ba2413d4d5 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -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( @@ -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, @@ -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', @@ -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( @@ -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', diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php index 545c498ccb..bd0d349d46 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/departments/class-phila-gov-cpt-departments.php b/wp/wp-content/plugins/phila.gov-customization/admin/departments/class-phila-gov-cpt-departments.php index 0a9bb08c25..ddd1e561d2 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/departments/class-phila-gov-cpt-departments.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/departments/class-phila-gov-cpt-departments.php @@ -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( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php b/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php index 5abb9b84d4..6ea753fd42 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php @@ -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( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/guides/class-phila-gov-cpt-guides.php b/wp/wp-content/plugins/phila.gov-customization/admin/guides/class-phila-gov-cpt-guides.php index a026ceaa35..65b5e2437a 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/guides/class-phila-gov-cpt-guides.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/guides/class-phila-gov-cpt-guides.php @@ -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' ), diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js index 3efe8d2db1..c6a4196161 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js +++ b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js @@ -17,6 +17,43 @@ function phila_user_read_only(){ /* For all admins */ jQuery(document).ready(function($) { + var currentURL = window.location.href; + +if (currentURL.indexOf('edit-tags.php') > -1) { + //remove news highlighting + $('.menu-icon-post').removeClass('wp-has-current-submenu wp-menu-open'); + $('.menu-icon-post').addClass('wp-not-current-submenu'); + //remove service page highlighting + $('.menu-icon-service_page').removeClass('wp-has-current-submenu wp-menu-open'); + $('.menu-icon-service_page').addClass('wp-not-current-submenu'); + + if(currentURL.indexOf('edit-tags.php?taxonomy=post_tag') > -1){ + //add tags highlighting + $('.toplevel_page_edit-tags\\?taxonomy\\=post_tag').removeClass('wp-not-current-submenu'); + $('.toplevel_page_edit-tags\\?taxonomy\\=post_tag').addClass('wp-has-current-submenu wp-menu-open'); + } + + if (currentURL.indexOf('edit-tags.php?taxonomy=service_type&post_type=service_page') > -1) { + //add categories highlighting + $('.toplevel_page_edit-tags\\?taxonomy\\=service_type\\&post_type\\=service_page').removeClass('wp-not-current-submenu'); + $('.toplevel_page_edit-tags\\?taxonomy\\=service_type\\&post_type\\=service_page').addClass('wp-has-current-submenu wp-menu-open'); + } + + if(currentURL.indexOf('edit-tags.php?taxonomy=audience') > -1){ + //add audience highlighting + $('.toplevel_page_edit-tags\\?taxonomy\\=audience').removeClass('wp-not-current-submenu'); + $('.toplevel_page_edit-tags\\?taxonomy\\=audience').addClass('wp-has-current-submenu wp-menu-open'); + } + + if(currentURL.indexOf('edit-tags.php?taxonomy=category') > -1){ + //add categories highlighting + $('.toplevel_page_edit-tags\\?taxonomy\\=category').removeClass('wp-not-current-submenu'); + $('.toplevel_page_edit-tags\\?taxonomy\\=category').addClass('wp-has-current-submenu wp-menu-open'); + } + +} + + // Set error placement, and highlights for category selection jQuery.validator.setDefaults({ errorPlacement: function( error, element ) { diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php b/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php index af605ef5bb..8d60fdce6f 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php @@ -23,14 +23,14 @@ function create_phila_programs_initiatives() { 'name' => __( 'Programs' ), 'menu_name' => __('Programs'), 'singular_name' => __( 'Program ' ), - 'add_new' => __( 'Add a Program' ), - 'all_items' => __( 'All Programs' ), - 'add_new_item' => __( 'Add a Page' ), - 'edit_item' => __( 'Edit a Page' ), - 'view_item' => __( 'View a Page' ), - 'search_items' => __( 'Search Programs Pages' ), - 'not_found' => __( 'No Programs Found' ), - 'not_found_in_trash' => __( 'Program Page not found in trash' ), + 'add_new' => __( 'Add a program' ), + 'all_items' => __( 'All programs' ), + 'add_new_item' => __( 'Add program page' ), + 'edit_item' => __( 'Edit a page' ), + 'view_item' => __( 'View a page' ), + 'search_items' => __( 'Search programs pages' ), + 'not_found' => __( 'No programs found' ), + 'not_found_in_trash' => __( 'Program page not found in trash' ), ), 'taxonomies' => array('category'), 'supports' => array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-cpt-service-page.php b/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-cpt-service-page.php index fb6c52a476..97275b270d 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-cpt-service-page.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-cpt-service-page.php @@ -22,15 +22,15 @@ function create_phila_service_pages() { 'labels' => array( 'name' => __( 'Services' ), 'menu_name' => __('Services'), - 'singular_name' => __( 'Service Page' ), - 'add_new' => __( 'Add a Service Page' ), - 'all_items' => __( 'All Service Pages' ), - 'add_new_item' => __( 'Add a Service Page' ), - 'edit_item' => __( 'Edit Service Page' ), - 'view_item' => __( 'View Service Page' ), - 'search_items' => __( 'Search Service Pages' ), - 'not_found' => __( 'No Service Pages Found' ), - 'not_found_in_trash' => __( 'Service Page not found in trash' ), + 'singular_name' => __( 'Service page' ), + 'add_new' => __( 'Add service page' ), + 'all_items' => __( 'All services' ), + 'add_new_item' => __( 'Add service page' ), + 'edit_item' => __( 'Edit service page' ), + 'view_item' => __( 'View service page' ), + 'search_items' => __( 'Search service pages' ), + 'not_found' => __( 'No service pages Found' ), + 'not_found_in_trash' => __( 'Service page not found in trash' ), ), 'taxonomies' => array('category', 'topics'), 'supports' => array( From 10b631e1a6a17aff4a5d248f400f6a85fa2f881d Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Fri, 15 Dec 2023 09:24:11 -0500 Subject: [PATCH 053/209] changed labels for calendar and text blocks --- .../plugins/phila.gov-customization/admin/js/admin.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js index c6a4196161..13ac008c41 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js +++ b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js @@ -53,6 +53,11 @@ if (currentURL.indexOf('edit-tags.php') > -1) { } +$('#menu-posts-calendar a:contains("All Calendars")').text('All calendars'); +$('#menu-posts-calendar a:contains("Add New")').text('Add calendar'); + +$('#menu-posts-text-blocks a:contains("All Text Blocks")').text('All text blocks'); +$('#menu-posts-text-blocks a:contains("Add New")').text('Add text block'); // Set error placement, and highlights for category selection jQuery.validator.setDefaults({ From 1f25b3ad4bf0b89f603999a4f8bf0a593ec758f1 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Wed, 3 Jan 2024 09:52:28 -0500 Subject: [PATCH 054/209] added post to series relationship --- .../class-phila-gov-custom-post-types.php | 1 + .../admin/meta-boxes/class-phila-gov-post.php | 2 +- .../class-phila-gov-standard-metaboxes.php | 20 ++++------------ .../phila.gov-theme/css/scss/pages/_post.scss | 10 ++++++++ .../themes/phila.gov-theme/functions.php | 23 +++++++++++++++++++ .../partials/phila-series-block.php | 21 ----------------- .../partials/posts/advanced-post-content.php | 3 --- .../partials/posts/phila-series.php | 10 ++++++-- .../phila.gov-theme/templates/single-post.php | 16 ++++++++++++- 9 files changed, 63 insertions(+), 43 deletions(-) delete mode 100644 wp/wp-content/themes/phila.gov-theme/partials/phila-series-block.php diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index 884926767e..44a8c263e6 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -39,6 +39,7 @@ public function __construct(){ add_action( 'init', array( $this, 'create_phila_news_post' ) ); add_action( 'init', array( $this, 'create_phila_press_release' ) ); add_action( 'init', array( $this, 'create_phila_advanced_post' ) ); + add_action( 'init', array( $this, 'create_phila_series' ) ); } diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php index f8f80e61be..ce9b2a5d79 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php @@ -385,7 +385,7 @@ function register_meta_boxes_posts($meta_boxes){ $meta_boxes[] = array( 'id' => 'phila_adv_series', - 'title' => 'Series content', + 'title' => 'Series linking text', 'priority' => 'high', 'pages' => array('post'), 'revision' => true, diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index 0f48d3123c..6051df6332 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1694,23 +1694,14 @@ public static function phila_metabox_row() ); } - public static function phila_series_row() - { + public static function phila_series_row() { return array( - 'id' => 'phila_adv_series_content', - 'type' => 'group', - 'fields' => array( - array( - 'id' => 'series_linking_text', - 'name' => 'Series linking text', - 'type' => 'text', - ), - Phila_Gov_Standard_Metaboxes::phila_post_selector($multiple = true, $post_types = ['post', 'advanced_post']), - ), + 'id' => 'phila_series_linking_text', + 'name' => 'Linking text', + 'type' => 'text', ); } - public static function phila_adv_posts_options() { return array( @@ -1730,8 +1721,7 @@ public static function phila_adv_posts_options() 'phila_qna' => 'Q&A', 'phila_timeline' => 'Timeline', 'phila_adv_stepped_process' => 'Stepped Procress', - 'phila_image_gallery' => 'Image Gallery', - 'phila_series' => 'Series' + 'phila_image_gallery' => 'Image Gallery' ) ), array( diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_post.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_post.scss index 304c025108..54e8fa089a 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_post.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_post.scss @@ -215,6 +215,16 @@ } } +.series-blockquote{ + blockquote { + border-left: 2px solid black; + padding-left: 15px; + } + blockquote:before { + content: ' ' !important; + } +} + #longform-content-single-container { body { margin-top: 0px !important; diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index eee1230425..98023b548c 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -1993,6 +1993,29 @@ function phila_weighted_search_results(){ } ); +add_action( 'mb_relationships_init', function() { + MB_Relationships_API::register( array( + 'id' => 'series_to_post_relationship', + 'from' => array( + 'object_type' => 'post', + 'post_type' => 'post', + 'meta_box' => array( + 'visible' => array( + 'when' => array( + array('phila_template_select', '=', 'series'), + ), + ), + 'title' => 'Series content' + ) + ), + 'to' => array( + 'object_type' => 'post', + 'post_type' => 'post', + ), + 'reciprocal' => true, + ) ); +} ); + function phila_language_output($language){ switch ($language) { case 'english'; diff --git a/wp/wp-content/themes/phila.gov-theme/partials/phila-series-block.php b/wp/wp-content/themes/phila.gov-theme/partials/phila-series-block.php deleted file mode 100644 index 9666cfae95..0000000000 --- a/wp/wp-content/themes/phila.gov-theme/partials/phila-series-block.php +++ /dev/null @@ -1,21 +0,0 @@ - - - - - \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php index c8ec36df91..2ed4542dcf 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/advanced-post-content.php @@ -19,8 +19,5 @@ $title = $page_row['phila_adv_posts_options']['phila_adv_posts_image_gallery']['phila_image_gallery_details']['phila_image_gallery_title']; $description = $page_row['phila_adv_posts_options']['phila_adv_posts_image_gallery']['phila_image_gallery_details']['phila_image_gallery_description']; include(locate_template('partials/phila_blog_adv_image_gallery.php')); - } elseif ($page_row['phila_adv_posts_options']['phila_adv_posts_select_options'] == 'phila_series') { - $series = $page_row['phila_adv_posts_options']['phila_adv_series']; - include(locate_template('partials/phila-series-block.php')); } } ?> \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php index 73d89b45ff..7065a30613 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php @@ -1,9 +1,14 @@ - 'series_to_post_relationship', + 'from' => get_the_ID(), +] ); ?>
    post_type; ?> @@ -31,5 +36,6 @@
    \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/templates/single-post.php b/wp/wp-content/themes/phila.gov-theme/templates/single-post.php index a2a1f53350..b648464a1f 100644 --- a/wp/wp-content/themes/phila.gov-theme/templates/single-post.php +++ b/wp/wp-content/themes/phila.gov-theme/templates/single-post.php @@ -29,7 +29,13 @@ } else if ($archived == 'archive_now') { $archived_state = 2; //archived manually } - +$connected = new WP_Query( [ + 'relationship' => [ + 'id' => 'series_to_post_relationship', + 'from' => get_the_ID(), + ], + 'nopaging' => true, +] ); ?>
    > @@ -142,6 +148,14 @@
    + have_posts() ) : $connected->the_post(); + $content = get_post_field('phila_series_linking_text', $connected->the_ID(), $context = 'display'); ?> + + From 03a90aa5cbe2c4d76a5e672425f8ae9f6378ba41 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Wed, 3 Jan 2024 11:35:51 -0500 Subject: [PATCH 055/209] Merge branch 'main' into blog_posts --- scripts/composer.sh | 10 +- scripts/deploy.sh | 3 +- scripts/install.sh | 21 ---- .../admin/class-phila-gov-admin-menu.php | 107 +++--------------- .../class-phila-gov-department-sites.php | 4 +- .../class-phila-gov-cpt-departments.php | 4 +- .../class-phila-gov-cpt-event-spotlight.php | 4 +- .../guides/class-phila-gov-cpt-guides.php | 2 +- .../admin/meta-boxes/class-phila-gov-post.php | 1 + .../admin/meta-boxes/meta-boxes.php | 1 + .../class-phila-gov-cpt-programs.php | 6 +- .../class-phila-gov-cpt-service-page.php | 2 +- .../controllers/class-phila-service-pages.php | 59 +++++++++- .../public/shortcodes/program-tiles.php | 2 +- .../css/scss/base/_global-nav.scss | 29 +---- .../themes/phila.gov-theme/footer.php | 4 +- .../themes/phila.gov-theme/front-page.php | 4 +- .../themes/phila.gov-theme/functions.php | 82 +++++++++++++- .../themes/phila.gov-theme/header.php | 2 +- .../phila.gov-theme/inc/custom-header.php | 4 +- .../inc/resource-list-switch.php | 37 +++--- .../phila.gov-theme/js/dev/phila-gov.js | 2 +- .../themes/phila.gov-theme/js/dev/posts.js | 4 +- .../phila.gov-theme/js/dev/translations.js | 24 ++++ .../partials/content-custom-additional.php | 4 +- .../partials/content-feedback.php | 2 +- .../partials/content-phila-row.php | 4 +- .../departments/content-custom-text-multi.php | 1 - .../departments/content-get-involved.php | 2 +- .../departments/phila_linked_image_grid.php | 2 +- .../phila_staff_directory_loop.php | 4 +- .../ppr/ppr-feat-locationType-card.php | 2 +- .../departments/v2/collection-page.php | 2 +- .../departments/v2/content-footer.php | 4 +- .../departments/v2/homepage_programs.php | 2 +- .../partials/departments/v2/member_list.php | 6 +- .../partials/departments/v2/photo-callout.php | 13 ++- .../partials/departments/v2/things-to-do.php | 2 +- .../partials/event-spotlight/card.php | 2 +- .../partials/event-spotlight/header.php | 2 +- .../partials/posts/action-guide-title.php | 2 +- .../partials/programs/header.php | 2 +- .../partials/services/content-topic-page.php | 12 +- .../templates/single-off-site.php | 2 +- wp/wp-includes/SimplePie/Parser.php | 4 +- 45 files changed, 266 insertions(+), 228 deletions(-) delete mode 100755 scripts/install.sh diff --git a/scripts/composer.sh b/scripts/composer.sh index d8a276d7e4..8d903d5770 100644 --- a/scripts/composer.sh +++ b/scripts/composer.sh @@ -54,13 +54,13 @@ echo ' "wpackagist-plugin/better-search-replace":"1.4.3", "wpackagist-plugin/disable-gutenberg":"2.8.1", "wpackagist-plugin/jwt-auth":"2.1.3", - "wpackagist-plugin/gathercontent-import":"3.2.17", - "wpackagist-plugin/easy-wp-smtp":"^2.1.2", + "wpackagist-plugin/gathercontent-import":"3.2.19", + "wpackagist-plugin/easy-wp-smtp":"^2.2.0", "wpackagist-plugin/admin-email-as-from-address":"^1.2", "wpackagist-plugin/jwt-authentication-for-wp-rest-api":"1.3.2", - "wpackagist-plugin/meta-box":"^5.7.5", - "wpackagist-plugin/mb-rest-api":"^1.5.1", - "wpackagist-plugin/mb-relationships":"^1.11.1", + "wpackagist-plugin/meta-box":"^5.8.2", + "wpackagist-plugin/mb-rest-api":"^2.0.1", + "wpackagist-plugin/mb-relationships":"^1.11.2", "wpackagist-plugin/meta-box-text-limiter":"^1.1.3", "wpackagist-plugin/miniorange-saml-20-single-sign-on":"^5.0.7", "wpackagist-plugin/reusable-text-blocks":"^1.5.3", diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 9c11350667..013840658c 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -12,7 +12,8 @@ echo 'Running wp-config.sh' echo 'Running build tasks' cd /home/ubuntu/app/wp/wp-content/themes/phila.gov-theme -npm install +# npm ci checks the cache and installs dependencies that have changed +npm ci --prefer-offline --cache /home/ubuntu/.npm if [ "$PHILA_TEST" ]; then echo 'Running test machine tasks' npm run dev:build diff --git a/scripts/install.sh b/scripts/install.sh deleted file mode 100755 index ea6d861320..0000000000 --- a/scripts/install.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -_dir="$(dirname "$0")" - -export DEBIAN_FRONTEND=noninteractive - -sudo apt-get update - -echo "Install npm" -cd /home/ubuntu/app/wp/wp-content/themes/phila.gov-theme -npm install -npm cache verify -cd /home/ubuntu/app - -if [ "$PHILA_TEST" ]; then - $_dir/unison.sh - $_dir/gen-cert.sh - $_dir/wp-config.sh - $_dir/db-config.sh - $_dir/local-db.sh -fi diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php index 1c079920e0..cc9b4a705e 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php @@ -26,12 +26,11 @@ 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 ); + } function admin_menu_order( $menu_ord ) { @@ -41,39 +40,21 @@ function admin_menu_order( $menu_ord ) { } return array( 'index.php', - 'resource-hub', - 'separator1', 'edit.php', + 'edit.php?post_type=page', + 'separator1', 'edit.php?post_type=service_page', - 'edit.php?post_type=programs', 'edit.php?post_type=department_page', + 'edit.php?post_type=programs', + 'edit.php?post_type=staff_directory', 'edit.php?post_type=document', + 'edit.php?post_type=longform_content', 'separator2', 'edit.php?post_type=event_spotlight', - 'edit.php?post_type=guides', - 'edit.php?post_type=longform_content', - 'nestedpages', - 'separator3', - 'edit.php?post_type=staff_directory', - 'upload.php', 'edit.php?post_type=calendar', - 'edit.php?post_type=text-blocks', - 'edit.php?post_type=service_updates', - 'edit.php?post_type=site_wide_alert', - 'separator4', - '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', - 'separator5', - 'themes.php', - 'phila_gov', - 'options-general.php', + 'edit.php?post_type=site_wide_alert', + 'upload.php', 'separator-last', - 'tools.php', - 'plugins.php', ); } @@ -82,84 +63,32 @@ function phila_change_post_label() { $labels = &$wp_post_types['post']->labels; $labels->name = 'The latest news + events'; $labels->singular_name = 'Latest item'; - $labels->add_new = 'Add news item'; - $labels->add_new_item = 'Add news item'; + $labels->add_new = 'Add new item to the latest'; + $labels->add_new_item = 'Add new 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 news'; - $labels->menu_name = 'News'; - $labels->name_admin_bar = 'News'; + $labels->all_items = 'All items'; + $labels->menu_name = 'The latest'; + $labels->name_admin_bar = 'The latest'; } - 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'; -} - - -function change_admin_post_label(){ - function owner_callback() { - wp_redirect('edit-tags.php?taxonomy=category'); - } - global $menu, $submenu; - $submenu['upload.php'][5][0] = 'All Media'; - $submenu['upload.php'][10][0] = 'Add New Media'; - $menu[997] = ['', 'read', 'separator3', '', 'wp-menu-separator']; - $menu[998] = ['', 'read', 'separator4', '', 'wp-menu-separator']; - $menu[999] = ['', 'read', 'separator5', '', 'wp-menu-separator']; + function change_admin_post_label(){ // 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_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=department_page', 'Nav Menu', 'Nav Menu', 'edit_posts', 'nav-menus.php'); + + add_submenu_page( 'edit.php?post_type=programs', 'Nav Menu', 'Nav Menu', 'edit_posts', 'nav-menus.php'); remove_menu_page( '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&post_type=service_page'); - remove_submenu_page('edit.php?post_type=service_page', 'edit-tags.php?taxonomy=audience&post_type=service_page'); - remove_submenu_page('edit.php?post_type=service_page', 'edit-tags.php?taxonomy=service_type&post_type=service_page'); - remove_submenu_page('edit.php?post_type=programs', 'edit-tags.php?taxonomy=category&post_type=programs'); - remove_submenu_page('edit.php?post_type=programs', 'edit-tags.php?taxonomy=audience&post_type=programs'); - remove_submenu_page('edit.php?post_type=programs', 'edit-tags.php?taxonomy=service_type&post_type=programs'); - remove_submenu_page('edit.php?post_type=department_page', 'edit-tags.php?taxonomy=category&post_type=department_page'); - remove_submenu_page('edit.php?post_type=document', 'edit-tags.php?taxonomy=category&post_type=document'); - remove_submenu_page('edit.php?post_type=event_spotlight', 'edit-tags.php?taxonomy=category&post_type=event_spotlight'); - remove_submenu_page('edit.php?post_type=guides', 'edit-tags.php?taxonomy=category&post_type=guides'); - remove_submenu_page('edit.php?post_type=longform_content', 'edit-tags.php?taxonomy=category&post_type=longform_content'); - remove_submenu_page('edit.php?post_type=staff_directory', 'edit-tags.php?taxonomy=category&post_type=staff_directory'); - remove_submenu_page('edit.php?post_type=calendar', 'edit-tags.php?taxonomy=category&post_type=calendar'); - remove_submenu_page('edit.php?post_type=service_updates', 'edit-tags.php?taxonomy=category&post_type=service_updates'); + add_submenu_page( 'edit.php', 'Announcements', 'Announcements', 'edit_posts', 'edit.php?post_type=announcement'); } - function phila_register_categories_for_pages(){ register_taxonomy_for_object_type('category', 'page'); diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-department-sites.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-department-sites.php index f95f153157..9c8fabdb02 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-department-sites.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-department-sites.php @@ -112,7 +112,7 @@ function content_blocks_shortcode( $atts ) { $block_image = isset( $array_value['phila_block_image'] ) ? $array_value['phila_block_image'] : ''; if ( !$block_image == '' ) { - $output .= ''; + $output .= ''; } $block_title = isset( $array_value['phila_block_content_title'] ) ? $array_value['phila_block_content_title'] : ''; @@ -128,7 +128,7 @@ function content_blocks_shortcode( $atts ) { $block_image = isset( $array_value['phila_block_image'] ) ? $array_value['phila_block_image'] : ''; if ( !$block_image == '' ) { - $output .= ''; + $output .= ''; } $output .= '
    '; diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/departments/class-phila-gov-cpt-departments.php b/wp/wp-content/plugins/phila.gov-customization/admin/departments/class-phila-gov-cpt-departments.php index 0a9bb08c25..0b0a036b2b 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/departments/class-phila-gov-cpt-departments.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/departments/class-phila-gov-cpt-departments.php @@ -21,10 +21,10 @@ function create_phila_department_pages() { array( 'labels' => array( 'name' => __( 'Department page' ), - 'menu_name' => __('Department Pages'), + 'menu_name' => __('Department Site'), 'singular_name' => __( 'Department page' ), 'add_new' => __( 'Add a Page' ), - 'all_items' => __( 'All Department Pages' ), + 'all_items' => __( 'All Pages' ), 'add_new_item' => __( 'Add a Department Page' ), 'edit_item' => __( 'Edit Department Page' ), 'view_item' => __( 'View Department Page' ), diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php b/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php index 9acb9d82a7..f1d17c41b7 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/event-spotlight/class-phila-gov-cpt-event-spotlight.php @@ -23,8 +23,8 @@ function create_phila_event_spotlight() { 'name' => __( 'Event Spotlight page' ), 'menu_name' => __('Event Spotlight'), 'singular_name' => __( 'Event Spotlight page' ), - 'add_new' => __( 'Add Spotlight Page' ), - 'all_items' => __( 'All Spotlights' ), + 'add_new' => __( 'Add a Page' ), + 'all_items' => __( 'All Pages' ), 'add_new_item' => __( 'Add a Event Spotlight Page' ), 'edit_item' => __( 'Edit Event Spotlight Page' ), 'view_item' => __( 'View Event Spotlight Page' ), diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/guides/class-phila-gov-cpt-guides.php b/wp/wp-content/plugins/phila.gov-customization/admin/guides/class-phila-gov-cpt-guides.php index a026ceaa35..3ec5874d72 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/guides/class-phila-gov-cpt-guides.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/guides/class-phila-gov-cpt-guides.php @@ -23,7 +23,7 @@ function create_phila_guides() { 'name' => __( 'Guides' ), 'menu_name' => __('Guides '), 'singular_name' => __( 'Guide' ), - 'add_new' => __( 'Add Guide page' ), + 'add_new' => __( 'Add a Guide page' ), 'all_items' => __( 'All guides' ), 'add_new_item' => __( 'Add a Page' ), 'edit_item' => __( 'Edit a Page' ), diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php index ce9b2a5d79..d399f19a53 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php @@ -140,6 +140,7 @@ function register_meta_boxes_posts($meta_boxes){ 'name' => 'Date for last updated', 'id' => 'last_updated_date', 'type' => 'date', + 'required' => true, 'js_options'=> array( 'dateFormat' => 'mm/dd/yy', 'maxDate' => 0 diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php index b786c20885..1c5b07a094 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php @@ -891,6 +891,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'visible' => array('phila_template_select', 'topic_page'), 'fields' => array( + Phila_Gov_Standard_Metaboxes::phila_metabox_v2_phila_advanced_small_wysiwyg('Topic Page Content'), array( 'name' => 'Hide child pages', 'type' => 'heading' diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php b/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php index f26bce32d0..d4694a59fb 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/programs-initiatives/class-phila-gov-cpt-programs.php @@ -20,11 +20,11 @@ function create_phila_programs_initiatives() { register_post_type( 'programs', array( 'labels' => array( - 'name' => __( 'Programs' ), - 'menu_name' => __('Programs'), + 'name' => __( 'Programs + Initiatives' ), + 'menu_name' => __('Programs + Initiatives'), 'singular_name' => __( 'Program + Initiative' ), 'add_new' => __( 'Add a Program or Initiative' ), - 'all_items' => __( 'All Programs' ), + 'all_items' => __( 'All Programs + Initiatives' ), 'add_new_item' => __( 'Add a Page' ), 'edit_item' => __( 'Edit a Page' ), 'view_item' => __( 'View a Page' ), diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-cpt-service-page.php b/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-cpt-service-page.php index fb6c52a476..9909890509 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-cpt-service-page.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-cpt-service-page.php @@ -21,7 +21,7 @@ function create_phila_service_pages() { array( 'labels' => array( 'name' => __( 'Services' ), - 'menu_name' => __('Services'), + 'menu_name' => __('Service Page'), 'singular_name' => __( 'Service Page' ), 'add_new' => __( 'Add a Service Page' ), 'all_items' => __( 'All Service Pages' ), diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-service-pages.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-service-pages.php index 6d1df3dbc1..1623dd9cd1 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-service-pages.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-service-pages.php @@ -135,9 +135,62 @@ public function get_items( $request ) { */ public function get_service_menu( $request ) { - $json_data = build_page_tree(); - - return $json_data; + $service_list = build_page_tree(); + + $full_mobile_menu = [ + [ + "ID" => 7, + "post_title" => "Services", + "post_name" => "services", + "post_link" => "https://www.phila.gov/services/", + "post_parent" => 0, + "post_type" => "page", + "collapsed" => true, + "children" => $service_list + ], + [ + "ID" => 2, + "post_title" => "Programs", + "post_name" => "programs", + "post_link" => "https://www.phila.gov/programs/", + "post_parent" => 0, + "post_type" => "page" + ], + [ + "ID" => 3, + "post_title" => "Departments", + "post_name" => "departments", + "post_link" => "https://www.phila.gov/departments/", + "post_parent" => 0, + "post_type" => "page" + ], + [ + "ID" => 4, + "post_title" => "Tools", + "post_name" => "tools", + "post_link" => "https://www.phila.gov/tools/", + "post_parent" => 0, + "post_type" => "page" + ], + [ + "ID" => 5, + "post_title" => "Publications", + "post_name" => "publications", + "post_link" => "https://www.phila.gov/documents/", + "post_parent" => 0, + "post_type" => "page" + ], + [ + "ID" => 6, + "post_title" => "News", + "post_name" => "news", + "post_link" => "https://www.phila.gov/the-latest/", + "post_parent" => 0, + "post_type" => "page" + ] + ]; + + return $full_mobile_menu; } diff --git a/wp/wp-content/plugins/phila.gov-customization/public/shortcodes/program-tiles.php b/wp/wp-content/plugins/phila.gov-customization/public/shortcodes/program-tiles.php index 956161060b..f6db8d4ef8 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/shortcodes/program-tiles.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/shortcodes/program-tiles.php @@ -26,7 +26,7 @@ function program_tile_shortcode($atts){ $output .= '" href="' . get_the_permalink($id) . '">'; $img = rwmb_meta( 'prog_header_img', $args = array( 'size' => 'medium', 'limit' => 1 ), $id ); $img = reset( $img ); - $output .= '' . $img['alt'] . ''; + $output .= '' . $img['alt'] . ''; $output .= '

    '. get_the_title($id) . '

    '; $output .= '

    ' . rwmb_meta( 'phila_meta_desc', array() ,$id) . '

    '; $output .= '
    diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss index 3d4db8d2a4..63179763de 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss @@ -11,7 +11,7 @@ .global-nav { @include secondary-font(400); position: relative; - z-index: 1000; + z-index: 998; ul { font-size: 14px; @@ -295,31 +295,6 @@ } #translations-menu { - //hidden languages in dropdown menu - #translate-haitian-creole-dropdown { - display: none; - } - - #translate-french-dropdown { - display: none; - } - - #translate-swahili-dropdown { - display: none; - } - - #translate-portuguese-dropdown { - display: none; - } - - #translate-russian-dropdown { - display: none; - } - - #translate-vietnamese-dropdown { - display: none; - } - #translations-support>a { font-weight: bold; text-decoration: underline; @@ -647,7 +622,7 @@ .top-bar-right .menu>li { >a:link { - @media screen and (min-width: 800px) and (max-width:950px) { + @media screen and (min-width: 800px) and (max-width:1024px) { padding: 2rem .5rem; } diff --git a/wp/wp-content/themes/phila.gov-theme/footer.php b/wp/wp-content/themes/phila.gov-theme/footer.php index 951c7e6a95..bf11925636 100644 --- a/wp/wp-content/themes/phila.gov-theme/footer.php +++ b/wp/wp-content/themes/phila.gov-theme/footer.php @@ -109,10 +109,10 @@ diff --git a/wp/wp-content/themes/phila.gov-theme/front-page.php b/wp/wp-content/themes/phila.gov-theme/front-page.php index 99d716a953..31cbd85530 100644 --- a/wp/wp-content/themes/phila.gov-theme/front-page.php +++ b/wp/wp-content/themes/phila.gov-theme/front-page.php @@ -14,7 +14,7 @@
    - +
    @@ -162,7 +162,7 @@
    'medium', 'limit' => 1), $post = '27984')[0]['url']; ?> - +

    Parks & Recreation Finder

    diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index 98023b548c..941dd36942 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -2268,9 +2268,10 @@ function inject_translation_slug($language) } function load_vue_mobile_menu() { - wp_enqueue_script('mobile-menu-chunk-js', 'https://www.phila.gov/embedded/mobile-menu/production/js/chunk-vendors.js?cachebreaker', array(), null, true ); - wp_enqueue_script('mobile-menu-app-js', 'https://www.phila.gov/embedded/mobile-menu/production/js/app.js?cachebreaker', array(), null, true ); - wp_enqueue_style('mobile-menu-app-css', 'https://www.phila.gov/embedded/mobile-menu/production/css/app.css?cachebreaker'); + global $phila_environment; + wp_enqueue_script('mobile-menu-chunk-js', 'https://www.phila.gov/embedded/mobile-menu/'.$phila_environment.'/js/chunk-vendors.js?cachebreaker', array(), null, true ); + wp_enqueue_script('mobile-menu-app-js', 'https://www.phila.gov/embedded/mobile-menu/'.$phila_environment.'/js/app.js?cachebreaker', array(), null, true ); + wp_enqueue_style('mobile-menu-app-css', 'https://www.phila.gov/embedded/mobile-menu/'.$phila_environment.'/css/app.css?cachebreaker'); } function load_vue_site_wide_alerts() { @@ -2278,4 +2279,79 @@ function load_vue_site_wide_alerts() { wp_enqueue_script('site-wide-alerts-chunk-js', 'https://www.phila.gov/embedded/site-wide-alerts/'.$phila_environment.'/js/chunk-vendors.js?cachebreaker', array(), null, true ); wp_enqueue_script('site-wide-alerts-app-js', 'https://www.phila.gov/embedded/site-wide-alerts/'.$phila_environment.'/js/app.js?cachebreaker', array(), null, true ); wp_enqueue_style('site-wide-alerts-app-css', 'https://www.phila.gov/embedded/site-wide-alerts/'.$phila_environment.'/css/app.css?cachebreaker'); +} + +function phila_return_language_code($language){ + switch ($language) { + case 'english'; + $language = 'en'; + break; + case 'french'; + $language = 'fr'; + break; + case 'spanish'; + $language = 'es'; + break; + case 'chinese'; + $language = 'zh'; + break; + case 'vietnamese'; + $language = 'vt'; + break; + case 'russian'; + $language = 'ru'; + break; + case 'arabic'; + $language = 'ar'; + break; + case 'haitian'; + $language = 'ht'; + break; + case 'portuguese'; + $language = 'pt'; + break; + case 'swahili'; + $language = 'sw'; + break; + case 'bengali'; + $language = 'bn'; + break; + case 'burmese'; + $language = 'my'; + break; + case 'hindo'; + $language = 'hi'; + break; + case 'indonesian'; + $language = 'id'; + break; + case 'urdu'; + $language = 'ur'; + break; + case 'korean'; + $language = 'ko'; + break; + case 'khmer'; + $language = 'km'; + break; + default; + $language = 'en'; + break; + } + return $language; +} + +add_filter('language_attributes', 'add_html_lang_attribute'); + +function add_html_lang_attribute($output) { + if ( function_exists( 'is_rtl' ) && is_rtl() ) { + $attributes[] = 'dir="rtl"'; + } + + $lang = empty(rwmb_meta('phila_select_language')) ? 'en' : rwmb_meta('phila_select_language'); + $language_code = phila_return_language_code($lang); + $attributes[] = 'lang="' . $language_code . '"'; + + $output = implode(' ', $attributes); + return $output; } \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/header.php b/wp/wp-content/themes/phila.gov-theme/header.php index 6da3b01529..805270f37a 100644 --- a/wp/wp-content/themes/phila.gov-theme/header.php +++ b/wp/wp-content/themes/phila.gov-theme/header.php @@ -163,7 +163,7 @@
    diff --git a/wp/wp-content/themes/phila.gov-theme/inc/custom-header.php b/wp/wp-content/themes/phila.gov-theme/inc/custom-header.php index 585ce8bfd0..23b9936de3 100644 --- a/wp/wp-content/themes/phila.gov-theme/inc/custom-header.php +++ b/wp/wp-content/themes/phila.gov-theme/inc/custom-header.php @@ -7,7 +7,7 @@ - + @@ -118,7 +118,7 @@ function phila_gov_admin_header_image() {

    onclick="return false;" href="">

    >
    - +
    diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/phila-gov.js b/wp/wp-content/themes/phila.gov-theme/js/dev/phila-gov.js index be51372b8d..6ec68e4967 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/phila-gov.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/phila-gov.js @@ -155,7 +155,7 @@ module.exports = $(function () { /* prevent search dropdown from becoming dissconnected from header when keyboard is closed on iOS devices */ - $('.search-field').focusout(function() { + $('#search-field').focusout(function() { if ( Foundation.MediaQuery.current === 'small' ) { window.scrollTo(0, 0); } diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/posts.js b/wp/wp-content/themes/phila.gov-theme/js/dev/posts.js index 9ce1b2466d..89d5611df5 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/posts.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/posts.js @@ -16,7 +16,7 @@ if (typeof phila_js_vars !== 'undefined') { $.ajax(ajaxURL).done(function (response) { var fullSizeImg = response._embedded["wp:featuredmedia"]["0"].media_details.sizes.full.source_url; var featuredCaption = response._embedded["wp:featuredmedia"]["0"].caption.rendered; - $modal.html(''); + $modal.html(''); if(response._embedded["wp:featuredmedia"]["0"].meta_box.phila_media_credit.length) { var featuredCredit = document.createElement("p"); @@ -126,7 +126,7 @@ $(function(){ //modal for any image that's been added to the page and linked to. var $modal = $('#phila-lightbox'); function loadContent(url){ - $modal.html('').foundation('open'); + $modal.html('').foundation('open'); $modal.append(closeButton); }; diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js b/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js index e6c9adcbc0..35914d36c2 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/translations.js @@ -48,6 +48,12 @@ module.exports = $(function () { $("#translate-chinese").text("中文"); $("#translate-chinese-dropdown").text("中文"); $("#translate-arabic-dropdown").text("عربي"); + $("#translate-haitian-creole-dropdown").text("Ayisyen"); + $("#translate-french-dropdown").text("Français"); + $("#translate-swahili-dropdown").text("Kiswahili"); + $("#translate-portuguese-dropdown").text("Português"); + $("#translate-russian-dropdown").text("русский"); + $("#translate-vietnamese-dropdown").text("Tiếng Việt"); function setOverflowHidden() { @@ -145,6 +151,24 @@ module.exports = $(function () { case "es": urlLanguage = "Español"; break; + case "ht": + urlLanguage = "Ayisyen"; + break; + case "fr": + urlLanguage = "Français"; + break; + case "sw": + urlLanguage = "Kiswahili"; + break; + case "pt": + urlLanguage = "Português"; + break; + case "ru": + urlLanguage = "русский"; + break; + case "vi": + urlLanguage = "Tiếng Việt"; + break; default: urlLanguage = "English"; } diff --git a/wp/wp-content/themes/phila.gov-theme/partials/content-custom-additional.php b/wp/wp-content/themes/phila.gov-theme/partials/content-custom-additional.php index ceb1a5b816..5a76e65289 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/content-custom-additional.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/content-custom-additional.php @@ -84,7 +84,8 @@
    - + +
    @@ -105,6 +106,5 @@
    -
    \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/content-feedback.php b/wp/wp-content/themes/phila.gov-theme/partials/content-feedback.php index dc6facd1ec..6fba2fcae5 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/content-feedback.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/content-feedback.php @@ -7,7 +7,7 @@
    - + -
    diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/content-get-involved.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/content-get-involved.php index b6a6e155ea..4d565a560e 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/content-get-involved.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/content-get-involved.php @@ -32,7 +32,7 @@
    - + diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_staff_directory_loop.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_staff_directory_loop.php index de3f3f187a..6743ae051a 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_staff_directory_loop.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_staff_directory_loop.php @@ -127,8 +127,8 @@ $staff_leadership_array[$staff_display_order] = $staff_leadership_output; else: - $staff_table_output .= ' - ' . $staff_member_name_output . ' + $staff_table_output .= ' + ' . $staff_member_name_output . ' ' . $staff_title . '
    ' . urldecode( $staff_unit ). ''; if (!empty($staff_email)) : $staff_table_output .= '' . $staff_email . ''; diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/ppr/ppr-feat-locationType-card.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/ppr/ppr-feat-locationType-card.php index b835cc7e79..3e4b65a533 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/ppr/ppr-feat-locationType-card.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/ppr/ppr-feat-locationType-card.php @@ -5,7 +5,7 @@ diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php index ba124a7078..8483d55bf7 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/collection-page.php @@ -93,7 +93,7 @@ 'medium', 'limit' => 1 ), $program_page ); $img = reset( $img );?> - <?php echo $img['alt']?> + <?php echo $img['alt']?>

    diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-footer.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-footer.php index a64f7e70de..7aeac3eafe 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-footer.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-footer.php @@ -20,7 +20,7 @@
    - +
    @@ -36,7 +36,7 @@ $slug) :?> 'full', 'limit' => 1 ), $id ); ?>
    - +
    diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/homepage_programs.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/homepage_programs.php index caf9ab49eb..3629ea18d1 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/homepage_programs.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/homepage_programs.php @@ -30,7 +30,7 @@ 'medium', 'limit' => 1 ), $card ); $img = reset( $img );?> - <?php echo $img['alt']?> + <?php echo $img['alt']?>

    diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/member_list.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/member_list.php index ddeeb8924e..c3ac4f2010 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/member_list.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/member_list.php @@ -1,6 +1,8 @@ ' : ''; ?> + echo isset( $member['headshot'] ) ? '' . $member['full_name'] .'' : ''; ?> ' . $member['email']. '
    ' : '' diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/photo-callout.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/photo-callout.php index fc32a29dfc..61e6111b9b 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/photo-callout.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/photo-callout.php @@ -36,8 +36,8 @@
    -
    -
    +
    +
    @@ -79,7 +79,7 @@
    - +
    @@ -101,7 +101,10 @@
    - - + +
    +
    + + \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/things-to-do.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/things-to-do.php index 7b57b29455..59f84ce0c5 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/things-to-do.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/things-to-do.php @@ -5,7 +5,7 @@

    Things To Do

    - +
    diff --git a/wp/wp-content/themes/phila.gov-theme/partials/event-spotlight/card.php b/wp/wp-content/themes/phila.gov-theme/partials/event-spotlight/card.php index d9840d4b65..f05986e296 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/event-spotlight/card.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/event-spotlight/card.php @@ -65,7 +65,7 @@
    - <?php echo $hero['alt'] ?> + <?php echo $hero['alt'] ?>
    Photo by ' . $credit . '
    ' : '' ?> diff --git a/wp/wp-content/themes/phila.gov-theme/partials/event-spotlight/header.php b/wp/wp-content/themes/phila.gov-theme/partials/event-spotlight/header.php index 8bd21fb9e1..29b7bedc5f 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/event-spotlight/header.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/event-spotlight/header.php @@ -26,7 +26,7 @@ ?>
    - <?php echo $hero['alt'] ?> + <?php echo $hero['alt'] ?>
    Photo by diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/action-guide-title.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/action-guide-title.php index adb2453aad..7b88c0e26a 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/action-guide-title.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/action-guide-title.php @@ -1,6 +1,6 @@ diff --git a/wp/wp-content/themes/phila.gov-theme/templates/single-off-site.php b/wp/wp-content/themes/phila.gov-theme/templates/single-off-site.php index 5bb08234fe..e34c5292fa 100644 --- a/wp/wp-content/themes/phila.gov-theme/templates/single-off-site.php +++ b/wp/wp-content/themes/phila.gov-theme/templates/single-off-site.php @@ -25,7 +25,7 @@ 'large', 'limit' => 1 ), $post->ID ); $img = reset( $img );?> - <?php echo $img['alt']?> + <?php echo $img['alt']?>
    You can find more information on on their website.
    diff --git a/wp/wp-includes/SimplePie/Parser.php b/wp/wp-includes/SimplePie/Parser.php index 3813b74b27..85ecb13d5e 100644 --- a/wp/wp-includes/SimplePie/Parser.php +++ b/wp/wp-includes/SimplePie/Parser.php @@ -581,12 +581,12 @@ private function parse_microformats(&$data, $url) { $hidden = $j === 0 ? '' : 'class="hidden" '; $description .= ''. - ''; + ''; } $description .= '
    '.$count.' photos

    '; } else if ($count == 1) { - $description = '

    '; + $description = '

    '; } } if (isset($entry['properties']['content'][0]['html'])) { From 33cbe1bd920a87bc79d23dfc91bf3b51aebb0724 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Mon, 8 Jan 2024 09:17:20 -0500 Subject: [PATCH 056/209] changed labels to sentence case --- .../admin/class-phila-gov-custom-post-types.php | 2 +- .../plugins/phila.gov-customization/admin/js/admin.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index ba2413d4d5..d93c75d434 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -367,7 +367,7 @@ function create_phila_longform_content() { register_post_type( 'longform_content', array( 'labels' => array( - 'name' => __( 'Long-form page' ), + 'name' => __( 'Long-form pages' ), 'singular_name' => __( 'Long-form page' ), 'add_new' => __( 'Add long-form page' ), 'all_items' => __( 'All long-form pages' ), diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js index 13ac008c41..d43252a762 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js +++ b/wp/wp-content/plugins/phila.gov-customization/admin/js/admin.js @@ -56,9 +56,12 @@ if (currentURL.indexOf('edit-tags.php') > -1) { $('#menu-posts-calendar a:contains("All Calendars")').text('All calendars'); $('#menu-posts-calendar a:contains("Add New")').text('Add calendar'); +$('#menu-posts-text-blocks div:contains("Text Blocks")').text('Text blocks'); $('#menu-posts-text-blocks a:contains("All Text Blocks")').text('All text blocks'); $('#menu-posts-text-blocks a:contains("Add New")').text('Add text block'); +$('#adminmenu a:contains("Nested View")').text('Nested view'); + // Set error placement, and highlights for category selection jQuery.validator.setDefaults({ errorPlacement: function( error, element ) { From f7924bd2a58d7b1dbe1aae22f3563c47067e4f81 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Thu, 11 Jan 2024 10:53:25 -0500 Subject: [PATCH 057/209] added cpt blog_post --- .../class-phila-gov-cpt-blog-posts.php | 60 +++++ .../class-phila-gov-custom-post-types.php | 77 +----- .../class-phila-gov-custom-taxonomies.php | 3 +- .../class-phila-gov-admin-templates.php | 29 +- .../class-phila-gov-item-meta-desc.php | 2 +- .../admin/meta-boxes/class-phila-gov-post.php | 14 +- .../admin/meta-boxes/meta-boxes.php | 6 +- .../plugins/phila.gov-customization/index.php | 2 + .../public/controllers/class-phila-pages.php | 4 +- .../public/controllers/class-phila-posts.php | 4 +- .../themes/phila.gov-theme/functions.php | 5 +- .../partials/posts/featured-grid.php | 4 +- .../phila.gov-theme/single-blog_post.php | 23 ++ .../phila.gov-theme/templates/blog_post.php | 249 ++++++++++++++++++ 14 files changed, 383 insertions(+), 99 deletions(-) create mode 100644 wp/wp-content/plugins/phila.gov-customization/admin/blog-posts/class-phila-gov-cpt-blog-posts.php create mode 100644 wp/wp-content/themes/phila.gov-theme/single-blog_post.php create mode 100644 wp/wp-content/themes/phila.gov-theme/templates/blog_post.php diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/blog-posts/class-phila-gov-cpt-blog-posts.php b/wp/wp-content/plugins/phila.gov-customization/admin/blog-posts/class-phila-gov-cpt-blog-posts.php new file mode 100644 index 0000000000..5047359146 --- /dev/null +++ b/wp/wp-content/plugins/phila.gov-customization/admin/blog-posts/class-phila-gov-cpt-blog-posts.php @@ -0,0 +1,60 @@ + 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' => 'blog-posts', + 'menu_icon' => 'dashicons-media-document', + 'hierarchical' => false, + 'supports' => array( + 'title', + 'editor', + 'thumbnail', + 'revisions' + ), + 'rewrite' => array( + 'slug' => 'posts', + 'with_front' => false, + ), + ) + ); + } + +} diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php index 44a8c263e6..bb02d0c51c 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-post-types.php @@ -38,8 +38,6 @@ public function __construct(){ add_action( 'init', array( $this, 'create_phila_posts' ) ); add_action( 'init', array( $this, 'create_phila_news_post' ) ); add_action( 'init', array( $this, 'create_phila_press_release' ) ); - add_action( 'init', array( $this, 'create_phila_advanced_post' ) ); - add_action( 'init', array( $this, 'create_phila_series' ) ); } @@ -331,80 +329,7 @@ function create_phila_press_release() { ) ); } - function create_phila_advanced_post() { - register_post_type( 'advanced_post', - array( - 'labels' => array( - 'name' => __( 'Advanced Posts' ), - 'menu_name' => __( 'Advanced Posts' ), - 'singular_name' => __( 'Advanced Post' ), - 'add_new' => __( 'Add Advanced Post' ), - 'all_items' => __( 'All Advanced Posts' ), - 'add_new_item' => __( 'Add New Advanced Post' ), - 'edit_item' => __( 'Edit Advanced Post' ), - 'view_item' => __( 'View Advanced Posts' ), - 'search_items' => __( 'Search Advanced Posts' ), - 'not_found' => __( 'Advanced Post Not Found' ), - 'not_found_in_trash' => __( 'Advanced Post not found in trash' ), - ), - 'taxonomies' => array( 'category' ), - 'supports' => array( - 'editor', - 'title', - 'revisions', - 'author' - ), - 'public' => true, - 'has_archive' => true, - 'show_in_menu' => false, - 'show_in_rest' => true, - 'rest_base' => 'advanced-posts', - 'menu_icon' => 'dashicons-editor-justify', - 'hierarchical' => false, - 'rewrite' => array( - 'slug' => 'advanced-posts', - 'with_front' => false, - ), - ) - ); - } - function create_phila_series() { - register_post_type( 'series', - array( - 'labels' => array( - 'name' => __( 'Series' ), - 'menu_name' => __( 'Series' ), - 'singular_name' => __( 'Series' ), - 'add_new' => __( 'Add Series' ), - 'all_items' => __( 'All Series' ), - 'add_new_item' => __( 'Add New Series' ), - 'edit_item' => __( 'Edit Series' ), - 'view_item' => __( 'View Series' ), - 'search_items' => __( 'Search Series' ), - 'not_found' => __( 'Series Not Found' ), - 'not_found_in_trash' => __( 'Series not found in trash' ), - ), - 'taxonomies' => array( 'category' ), - 'supports' => array( - 'editor', - 'title', - 'revisions', - 'author' - ), - 'public' => true, - 'has_archive' => true, - 'show_in_menu' => false, - 'show_in_rest' => true, - 'rest_base' => 'series', - 'menu_icon' => 'dashicons-editor-justify', - 'hierarchical' => false, - 'rewrite' => array( - 'slug' => 'series', - 'with_front' => false, - ), - ) - ); - } + function create_phila_staff_directory() { register_post_type( 'staff_directory', array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php index b0da9749d9..43190c0faf 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-custom-taxonomies.php @@ -194,7 +194,8 @@ function hierarchical_tags() { register_taxonomy( 'post_tag', array( 'post', - 'announcement' + 'announcement', + 'blog_post' ), array( 'hierarchical' => true, diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php index ef6c0e6a83..6dc6aaa9e8 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-admin-templates.php @@ -136,7 +136,7 @@ function register_template_selection_metabox_posts( $meta_boxes ){ $meta_boxes[] = array( 'title' => 'Select Template', - 'post_types' => array( 'post' ), + 'post_types' => array( 'post'), 'context' => 'after_title', 'fields' => array( array( @@ -147,8 +147,6 @@ function register_template_selection_metabox_posts( $meta_boxes ){ 'options' => array( 'post' => 'Post', 'press_release' => 'Press Release', - 'advanced_post' => 'Advanced Post', - 'series' => 'Series', 'action_guide' => 'Action Guide', 'action_guide_2' => 'Action Guide V2' ), @@ -161,6 +159,31 @@ function register_template_selection_metabox_posts( $meta_boxes ){ ), ); + $meta_boxes[] = array( + 'title' => 'Select Template', + 'post_types' => array( 'blog_post'), + 'context' => 'after_title', + 'fields' => array( + array( + 'placeholder' => 'Select a template', + 'id' => 'phila_template_select', + 'type' => 'select', + 'required' => true, + 'options' => array( + 'post' => 'Post', + 'press_release' => 'Press Release', + 'advanced_post' => 'Advanced Post', + 'series' => 'Series' + ), + 'admin_columns' => array( + 'position' => 'after date', + 'title' => __( 'Template' ), + 'sort' => true, + ), + ), + ), + ); + return $meta_boxes; diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-item-meta-desc.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-item-meta-desc.php index d86aba92ec..3f6f9dd8e1 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-item-meta-desc.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-item-meta-desc.php @@ -25,7 +25,7 @@ function phila_register_item_desc_meta_boxes( $meta_boxes ){ //TODO: replace this with a function that pulls the post types we need. It had been set up this way, but after a WP update, get_post_types was not returning CPTs. A quick fix needed to be put in place, and this is it. 'post_types' => array( - 'phila_post', 'news_post', 'department_page', 'service_page', 'document', 'press_release', 'page', 'post', 'programs', 'event_spotlight', 'guides' + 'phila_post', 'news_post', 'department_page', 'service_page', 'document', 'press_release', 'page', 'post', 'programs', 'event_spotlight', 'guides', 'blog_post' ), 'fields' => array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php index d399f19a53..0385a98e31 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php @@ -16,7 +16,7 @@ public function __construct(){ function register_meta_boxes_posts($meta_boxes){ $meta_boxes[] = array( 'title' => 'Additional authors', - 'pages' => array( 'post' ), + 'pages' => array( 'post', 'blog_post'), 'context' => 'after_title', 'visible' => array( 'when' => array( @@ -62,7 +62,7 @@ function register_meta_boxes_posts($meta_boxes){ $meta_boxes[] = array( 'title' => 'Social media share pre-filled text', - 'pages' => array( 'post' ), + 'pages' => array( 'post', 'blog_post' ), 'context' => 'after_title', 'fields' => array( array( @@ -103,7 +103,7 @@ function register_meta_boxes_posts($meta_boxes){ $meta_boxes[] = array ( 'title' => 'Language options', - 'pages' => array( 'post' ), + 'pages' => array( 'post', 'blog_post' ), 'context' => 'side', 'priority' => 'high', 'visible' => array( @@ -118,7 +118,7 @@ function register_meta_boxes_posts($meta_boxes){ $meta_boxes[] = array ( 'title' => 'Updates and archiving', - 'pages' => array( 'post' ), + 'pages' => array( 'post', 'blog_post'), 'context' => 'side', 'priority' => 'high', 'visible' => array( @@ -189,7 +189,7 @@ function register_meta_boxes_posts($meta_boxes){ $meta_boxes[] = array( 'title' => 'End of post call to action. Where should users go now?', - 'pages' => array( 'post' ), + 'pages' => array( 'post', 'blog_post'), 'context' => 'normal', 'priority' => 'high', 'visible' => array( @@ -371,7 +371,7 @@ function register_meta_boxes_posts($meta_boxes){ $meta_boxes[] = array( 'id' => 'phila_adv_posts', 'title' => 'Page content', - 'pages' => array('post'), + 'pages' => array('post', 'blog_post'), 'priority' => 'high', 'revision' => true, 'visible' => array( @@ -388,7 +388,7 @@ function register_meta_boxes_posts($meta_boxes){ 'id' => 'phila_adv_series', 'title' => 'Series linking text', 'priority' => 'high', - 'pages' => array('post'), + 'pages' => array('post', 'blog_post'), 'revision' => true, 'visible' => array( 'when' => array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php index 1c5b07a094..f777c12a71 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/meta-boxes.php @@ -183,7 +183,7 @@ function phila_register_meta_boxes( $meta_boxes ){ $meta_boxes[] = array( 'id' => 'press-release-date', 'title' => 'Release Date', - 'pages' => array( 'post' ), + 'pages' => array( 'post', 'blog_post'), 'context' => 'after_title', 'priority' => 'low', 'visible' => array( @@ -195,7 +195,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'fields' => array( array( 'name' => 'Release Date', - 'id' => 'phila_press_release_date', + 'id' => 'phila_press_release_date', 'type' => 'date', 'class' => 'press-release-date', 'size' => 30, @@ -210,7 +210,7 @@ function phila_register_meta_boxes( $meta_boxes ){ $meta_boxes[] = array( 'title' => 'Contact Information', - 'pages' => array( 'post' ), + 'pages' => array( 'post', 'blog_post' ), 'context' => 'after_title', 'priority' => 'low', 'visible' => array( diff --git a/wp/wp-content/plugins/phila.gov-customization/index.php b/wp/wp-content/plugins/phila.gov-customization/index.php index ada255fd66..6cd9f1d224 100644 --- a/wp/wp-content/plugins/phila.gov-customization/index.php +++ b/wp/wp-content/plugins/phila.gov-customization/index.php @@ -42,6 +42,8 @@ require $dir. '/admin/rest-additions.php'; require $dir. '/admin/tiny-mce.php'; +require $dir. '/admin/blog-posts/class-phila-gov-cpt-blog-posts.php'; + require $dir. '/admin/service-page/class-phila-gov-cpt-service-page.php'; require $dir. '/admin/service-page/class-phila-gov-service-register-templates.php'; diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-pages.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-pages.php index ef6e41e425..b66992f7bc 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-pages.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-pages.php @@ -33,7 +33,7 @@ public function get_items( $request ) { $posts = new WP_Query( array( 'category__in' => $department_id, - 'post_type' => array('post', 'page', 'service_updates', 'site_wide_alert', 'document', 'staff_directory', 'announcement', 'service_page', 'department_page', 'event_spotlight', 'guides', 'programs', 'calendar', 'phila_post', 'news_post', 'press_release'), + 'post_type' => array('post', 'page', 'service_updates', 'site_wide_alert', 'document', 'staff_directory', 'announcement', 'service_page', 'department_page', 'event_spotlight', 'guides', 'programs', 'calendar', 'phila_post', 'news_post', 'press_release', 'blog_post'), 'posts_per_page' => -1, 'order' => 'asc', 'orderby' => 'title', @@ -41,7 +41,7 @@ public function get_items( $request ) { ) ); } else { $posts = new WP_Query( array( - 'post_type' => array('post', 'page', 'service_updates', 'site_wide_alert', 'document', 'staff_directory', 'announcement', 'service_page', 'department_page', 'event_spotlight', 'guides', 'programs', 'calendar', 'phila_post', 'news_post', 'press_release'), + 'post_type' => array('post', 'page', 'service_updates', 'site_wide_alert', 'document', 'staff_directory', 'announcement', 'service_page', 'department_page', 'event_spotlight', 'guides', 'programs', 'calendar', 'phila_post', 'news_post', 'press_release', 'blog_post'), 'posts_per_page' => -1, 'order' => 'asc', 'orderby' => 'title', diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php index dd58802fdf..0a5d91b177 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/class-phila-posts.php @@ -112,7 +112,7 @@ public function set_query_defaults($request){ * @param WP_REST_Request $request Current request. */ public function get_items( $request ) { - $post_type = isset( $request['post_type'] ) ? array( $request['post_type']) : array('post', 'phila_post', 'press_release', 'news_post', 'advanced_post'); + $post_type = isset( $request['post_type'] ) ? array( $request['post_type']) : array('post', 'phila_post', 'press_release', 'news_post', 'advanced_post', 'blog_post'); $count = isset( $request['count'] ) ? $request['count'] : '40'; @@ -121,7 +121,7 @@ public function get_items( $request ) { switch($template) { case 'featured': $posts_args = array( - 'post_type' => array('post', 'news_post'), + 'post_type' => array('post', 'news_post', 'blog_post'), 'meta_query' => array( 'relation' => 'OR', array( diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index 941dd36942..414c782496 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -1998,19 +1998,20 @@ function phila_weighted_search_results(){ 'id' => 'series_to_post_relationship', 'from' => array( 'object_type' => 'post', - 'post_type' => 'post', + 'post_type' => 'blog_post', 'meta_box' => array( 'visible' => array( 'when' => array( array('phila_template_select', '=', 'series'), ), ), + 'context' => 'normal', 'title' => 'Series content' ) ), 'to' => array( 'object_type' => 'post', - 'post_type' => 'post', + 'post_type' => 'blog_post', ), 'reciprocal' => true, ) ); diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/featured-grid.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/featured-grid.php index 844c2d6ffc..2d756dbe69 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/featured-grid.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/featured-grid.php @@ -8,7 +8,7 @@ 1, - 'post_type' => array('post', 'news_post'), + 'post_type' => array('post', 'news_post', 'blog_post'), 'order' => 'desc', 'orderby' => 'date', 'meta_query' => array( @@ -60,7 +60,7 @@ 3, - 'post_type' => array('post', 'news_post'), + 'post_type' => array('post', 'news_post', 'blog_post'), 'order' => 'desc', 'orderby' => 'date', 'post__not_in' => array( $main_feature_id ), diff --git a/wp/wp-content/themes/phila.gov-theme/single-blog_post.php b/wp/wp-content/themes/phila.gov-theme/single-blog_post.php new file mode 100644 index 0000000000..1d4597a197 --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/single-blog_post.php @@ -0,0 +1,23 @@ + + +
    +
    + +
    +
    + \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/templates/blog_post.php b/wp/wp-content/themes/phila.gov-theme/templates/blog_post.php new file mode 100644 index 0000000000..c5c9486e25 --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/templates/blog_post.php @@ -0,0 +1,249 @@ + + $post->post_date) { // if posts are 2 years old + $post_is_old = true; +} +if ((empty( $archived ) || !isset($archived) || $archived == 'default') && $post_is_old) { + $archived_state = 1; //archived after two years +} else if ($archived == 'archive_now') { + $archived_state = 2; //archived manually +} +$connected = new WP_Query( [ + 'relationship' => [ + 'id' => 'series_to_post_relationship', + 'from' => get_the_ID(), + ], + 'nopaging' => true, +] ); +?> + +
    > +
    +
    + +
    +
    +
    + +
    Archived
    + + ', '' ); ?> +
    +
    +
    + + +
    +
    + +
    +
    +
    + Last updated format('F d, Y'); ?> + +

    This post was reviewed and manually archived because some of the content is out of date.

    + + +
    +
    +
    + +
    + = 2 ): ?> + + + + + + + +
    + have_posts() ) : $connected->the_post(); + $content = get_post_field('phila_series_linking_text', $connected->the_ID(), $context = 'display'); ?> + + + + + + + +
    + + + + + + + + +
    + +
    ###
    + +
    +
    +
    + + +cat_ID ); + } + + $cat_id_string = implode( ', ', $cat_ids ); + + $related_post_type = array( $post_type ); + $posts_per = 3; + + //fallback for old post types + if( $template_type == 'phila_post' || $template_type == 'post' ) { + array_push( $related_post_type, 'phila_post' ); + + }elseif( $template_type == 'press_release' ) { + array_push($related_post_type, 'press_release' ); + $posts_per = 4; + } + + $related_content_args = array( + 'post_type' => $related_post_type, + 'category__and' => array($cat_id_string), + 'posts_per_page' => $posts_per, + 'post__not_in' => array($post_id), + 'meta_query' => array( + array( + 'key' => 'phila_template_select', + 'value' => $template_type, + 'compare' => '=', + ), + array( + 'relation' => 'OR', + array( + 'key' => 'phila_select_language', + 'value' => 'english', + 'compare' => '=', + ), + array( + 'key' => 'phila_select_language', + 'value' => '', + 'compare' => '=', + ), + ), + ), + ); + + if ( ($post_type == 'press_release' || $template_type == 'press_release') ) { + $is_press_release = true; + $label = 'press_release'; + $count = 4; + $category = array($cat_id_string); + + $template = 'partials/posts/press-release-grid.php'; + }else{ + $template = 'partials/posts/content-related.php'; + } +?> +
    + +
    + + +
    +
    From 7a55677696d9258cefa7e42341e6197b1ac799d1 Mon Sep 17 00:00:00 2001 From: IshKeyes Date: Mon, 22 Jan 2024 09:27:31 -0500 Subject: [PATCH 058/209] span tag added --- .../themes/phila.gov-theme/partials/content-additional.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/content-additional.php b/wp/wp-content/themes/phila.gov-theme/partials/content-additional.php index d5cbb17965..a451d7a5a7 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/content-additional.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/content-additional.php @@ -100,7 +100,9 @@
    From 5cd151e02213498ce7af6999643b6b5501aa95cd Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Mon, 22 Jan 2024 09:41:46 -0500 Subject: [PATCH 059/209] testing archive --- wp/wp-content/themes/phila.gov-theme/functions.php | 1 + wp/wp-content/themes/phila.gov-theme/js/dev/phila-gov.js | 2 +- wp/wp-content/themes/phila.gov-theme/partials/breadcrumbs.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index 9ce08b5978..70151a8e1a 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -1288,6 +1288,7 @@ function phila_get_archive_status( $post_id ) { } else { $archived = false; } + return (bool) $archived; } diff --git a/wp/wp-content/themes/phila.gov-theme/js/dev/phila-gov.js b/wp/wp-content/themes/phila.gov-theme/js/dev/phila-gov.js index 6ec68e4967..012a82ccc7 100644 --- a/wp/wp-content/themes/phila.gov-theme/js/dev/phila-gov.js +++ b/wp/wp-content/themes/phila.gov-theme/js/dev/phila-gov.js @@ -14,7 +14,7 @@ module.exports = $(function () { var drilldownOptions = { autoHeight: false, - scrollTop: true, + scrollTop: false, parentLink: true, scrollTopElement: 'body' }; diff --git a/wp/wp-content/themes/phila.gov-theme/partials/breadcrumbs.php b/wp/wp-content/themes/phila.gov-theme/partials/breadcrumbs.php index eee30b332e..e3da71e337 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/breadcrumbs.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/breadcrumbs.php @@ -3,7 +3,7 @@ * Breadcrumbs */ ?> -
    +
    From 66486c40b7514776c3cd21d12976d81b3a084b71 Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Mon, 22 Jan 2024 09:42:49 -0500 Subject: [PATCH 060/209] testing archive --- package-lock.json | 6 + .../controllers/v2/class-phila-posts-v2.php | 107 +++++++++++++++--- 2 files changed, 97 insertions(+), 16 deletions(-) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..523ca589a1 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "phila.gov", + "lockfileVersion": 2, + "requires": true, + "packages": {} +} diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php index 9b5fb2e02d..72c200d18c 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php @@ -17,6 +17,7 @@ function get_phila_template( $post ) { } function get_archive_status( $post ) { + var_dump(phila_get_archive_status($post['id'])); return phila_get_archive_status($post['id']); } @@ -38,25 +39,80 @@ function get_phila_featured_media ( $post ) { } -function filter_post_by_archived( $args, $request ) { - $archived = $request->get_param( 'archived' ); - if ( empty( $archived )) { - return $args; - } - if ( $archived === 'true' ) { - $archived = 'archive_now'; - } else if ( $archived === 'false' ){ - $archived = 'default'; - } - $args['meta_query'][] = array( - 'key' => 'phila_archive_post', - 'value' => $archived, - 'compare' => '=', - ); +function filter_post_by_archived($args, $request) { + + $archived = $request->get_param('archived'); + + $two_years_ago = date('Y-m-d\TH:i:s', strtotime('-2 years')); + // $now = current_time('timestamp'); + // $archived = filter_var($archived, FILTER_VALIDATE_BOOLEAN); + + // if ($archived == 'true') { + // $args['meta_query'][] = array( + // // 'relation' => 'OR', + // // array( + // // 'key' => 'phila_archive_post', + // // 'value' => 'archive_now', + // // 'compare' => '=', + // // ), + // // array( + // // 'relation' => 'AND', + // // array( + // // 'key' => 'phila_archive_post', + // // 'value' => 'default', + // // 'compare' => '=', + // // ), + // // array( + // // 'before' => $two_years_ago, + // // 'inclusive' => true, + // // ), + // // array( + // // 'key' => 'modified', + // // 'value' => $two_years_ago, + // // 'compare' => '<', + // // 'type' => 'DATETIME', + // // ) + // // ), + // // array( + // // 'key' => 'phila_archive_post', + // // 'value' => '', + // // 'compare' => '=', + // // ), + // ); + // } else if ($archived == 'false') { + // $args['meta_query'][] = array( + // 'relation' => 'OR', + // array( + // 'key' => 'phila_archive_post', + // 'value' => 'do_not_archive', + // 'compare' => '=', + // ), + // array( + // 'relation' => 'AND', + // array( + // 'key' => 'phila_archive_post', + // 'value' => 'default', + // 'compare' => '=', + // ), + // array( + // 'after' => $two_years_ago, + // 'inclusive' => true, + // ), + // ), + // ); + // } + + if ($archived == 'true') { + $args['date_query'][] = array( + 'before' => $two_years_ago, + 'inclusive' => true, + ); + } + // var_dump($args); return $args; } @@ -113,4 +169,23 @@ function filter_post_by_template($args, $request) { ); return $args; -} \ No newline at end of file +} + +// function filter_post_by_archived($args, $request){ +// $archived = $request->get_param('archived'); + +// if ( empty( $archived )) { +// return $args; +// } + +// $archived = filter_var($archived, FILTER_VALIDATE_BOOLEAN); + +// $args['meta_query'][] = array( +// 'key' => 'is_archived', +// 'value' => $archived, +// 'compare' => '=', +// 'type' => 'BOOLEAN', +// ); + +// return $args; +// } \ No newline at end of file From ca0b630f2a6be5c84e02cbbe4e4e19d5846aed36 Mon Sep 17 00:00:00 2001 From: derrickdso Date: Fri, 26 Jan 2024 15:54:26 -0500 Subject: [PATCH 061/209] move mb-revision --- scripts/composer.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/composer.sh b/scripts/composer.sh index 8d903d5770..78dffc727d 100644 --- a/scripts/composer.sh +++ b/scripts/composer.sh @@ -26,6 +26,10 @@ echo ' "type": "vcs", "url": "https://github.com/CityOfPhiladelphia/phila-restrict-categories.git" }, + { + "type": "vcs", + "url": "https://github.com/CityOfPhiladelphia/phila-mb-revision.git" + }, { "type": "vcs", "url": "https://github.com/CityOfPhiladelphia/phila-google-calendar-events.git" @@ -40,9 +44,9 @@ echo ' "cityofphiladelphia/duplicate-and-merge-posts": "dev-'$GITHUB_BRANCH'", "cityofphiladelphia/google-calendar-events": "dev-'$GITHUB_BRANCH'", "cityofphiladelphia/restrict-categories": "dev-'$GITHUB_BRANCH'", + "cityofphiladelphia/mb-revision": "dev-'$GITHUB_BRANCH'", "kylephillips/nestedpages": "dev-main", "meta-box/mb-admin-columns":"dev-master", - "meta-box/mb-revision":"dev-master", "meta-box/mb-settings-page":"dev-master", "meta-box/mb-term-meta":"dev-master", "meta-box/meta-box-columns":"dev-master", From b24f766ff5f9981ea60d654bfcd548298871eff4 Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Tue, 30 Jan 2024 10:57:27 -0500 Subject: [PATCH 062/209] edit menu requirements for submenus --- .../admin/class-phila-gov-admin-menu.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php index 2316bc3fc2..d07e2d0b8d 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php @@ -178,10 +178,10 @@ 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=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', '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', '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', 'edit_posts', 'nav-menus.php'); remove_menu_page( 'edit.php?post_type=announcement' ); From b71b5e439dcf1a30f0fd669c4954e2e971feb6da Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Fri, 2 Feb 2024 13:14:09 -0500 Subject: [PATCH 063/209] testing user role menu addition --- .../admin/class-phila-gov-admin-menu.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php index d07e2d0b8d..b613f56db2 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php @@ -176,6 +176,9 @@ function change_admin_post_label(){ 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_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'); From 3bd0cd902af0ddad664b064fcac159c703a1e198 Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Mon, 26 Feb 2024 14:23:18 -0500 Subject: [PATCH 064/209] testing user roles menus --- .../admin/class-phila-gov-admin-menu.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php index b613f56db2..fe3007f33e 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-admin-menu.php @@ -178,14 +178,14 @@ function change_admin_post_label(){ 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', 'edit_posts', 'nav-menus.php'); + 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', 'edit_posts', 'nav-menus.php'); + 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' ); From c6143cc66ed301b79241bc553b90e50cfd605d91 Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Tue, 27 Feb 2024 18:11:22 -0500 Subject: [PATCH 065/209] Clarify archival needs --- .../controllers/v2/class-phila-posts-v2.php | 99 ++++++------------- 1 file changed, 32 insertions(+), 67 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php index 72c200d18c..ddd6474388 100644 --- a/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php +++ b/wp/wp-content/plugins/phila.gov-customization/public/controllers/v2/class-phila-posts-v2.php @@ -1,4 +1,4 @@ - 'get_archive_status' )); @@ -17,7 +17,6 @@ function get_phila_template( $post ) { } function get_archive_status( $post ) { - var_dump(phila_get_archive_status($post['id'])); return phila_get_archive_status($post['id']); } @@ -40,79 +39,45 @@ function get_phila_featured_media ( $post ) { } - - function filter_post_by_archived($args, $request) { $archived = $request->get_param('archived'); $two_years_ago = date('Y-m-d\TH:i:s', strtotime('-2 years')); - // $now = current_time('timestamp'); - // $archived = filter_var($archived, FILTER_VALIDATE_BOOLEAN); - - // if ($archived == 'true') { - // $args['meta_query'][] = array( - // // 'relation' => 'OR', - // // array( - // // 'key' => 'phila_archive_post', - // // 'value' => 'archive_now', - // // 'compare' => '=', - // // ), - // // array( - // // 'relation' => 'AND', - // // array( - // // 'key' => 'phila_archive_post', - // // 'value' => 'default', - // // 'compare' => '=', - // // ), - // // array( - // // 'before' => $two_years_ago, - // // 'inclusive' => true, - // // ), - // // array( - // // 'key' => 'modified', - // // 'value' => $two_years_ago, - // // 'compare' => '<', - // // 'type' => 'DATETIME', - // // ) - // // ), - // // array( - // // 'key' => 'phila_archive_post', - // // 'value' => '', - // // 'compare' => '=', - // // ), - // ); - // } else if ($archived == 'false') { - // $args['meta_query'][] = array( - // 'relation' => 'OR', - // array( - // 'key' => 'phila_archive_post', - // 'value' => 'do_not_archive', - // 'compare' => '=', - // ), - // array( - // 'relation' => 'AND', - // array( - // 'key' => 'phila_archive_post', - // 'value' => 'default', - // 'compare' => '=', - // ), - // array( - // 'after' => $two_years_ago, - // 'inclusive' => true, - // ), - // ), - // ); - // } - - if ($archived == 'true') { - $args['date_query'][] = array( - 'before' => $two_years_ago, - 'inclusive' => true, + + if ( $archived == 'true') { + $archived = 1; + } else if ( $archived == 'false' ){ + $archived = 0; + } + + if ($archived === 1) { + // show everything + $args['meta_query'][] = array(); + } else if ($archived === 0) { + //archived is false -- show everything that is not archived + $args['meta_query'][] = array( + 'relation' => 'OR', + array( + 'key' => 'phila_archive_post', + 'value' => 'do_not_archive', + 'compare' => '=', + ), + array( + 'relation' => 'AND', + array( + 'key' => 'phila_archive_post', + 'value' => 'default', + 'compare' => '=', + ), + array( + 'after' => $two_years_ago, + 'inclusive' => true, + ), + ), ); } - // var_dump($args); return $args; } From d2655c67fc9a4d8731bfd657e1bda8a727006021 Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Wed, 28 Feb 2024 12:05:19 -0500 Subject: [PATCH 066/209] update staff labels for content team --- .../admin/class-phila-gov-staff-directory.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php index c227d05520..3835cb9bfa 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php @@ -50,25 +50,25 @@ function phila_register_meta_boxes( $meta_boxes ){ 'fields' => array( array( - 'name' => 'First Name', + 'name' => 'First name
    (Required)', 'id' => $prefix . 'first_name', 'type' => 'text', 'class' => 'first-name', ), array( - 'name' => 'Middle Name / Initial', + 'name' => 'Middle name or initial', 'id' => $prefix . 'middle_name', 'type' => 'text', 'class' => 'middle-name', ), array( - 'name' => 'Last Name', + 'name' => 'Last name
    (Required)', 'id' => $prefix . 'last_name', 'type' => 'text', 'class' => 'last-name', ), array( - 'name' => 'Name Suffix
    (Optional)', + 'name' => 'Name Suffix
    (Optional)', 'id' => $prefix . 'name_suffix', 'type' => 'select', 'class' => 'name-suffix', @@ -89,12 +89,12 @@ function phila_register_meta_boxes( $meta_boxes ){ ), ), array( - 'name' => 'Professional Certification
    (Optional)', + 'name' => 'Professional certification
    (Optional)', 'id' => $prefix . 'prof_cert', 'type' => 'text', ), array( - 'name' => 'Job Title', + 'name' => 'Job title', 'id' => $prefix . 'job_title', 'type' => 'text', 'class' => 'job-title', From 595cf5641b330f28aaf2ad9a29e48e7ee5831aa2 Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Wed, 28 Feb 2024 12:10:41 -0500 Subject: [PATCH 067/209] make job title required --- .../admin/class-phila-gov-staff-directory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php index 3835cb9bfa..689036b9e6 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php @@ -94,7 +94,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'type' => 'text', ), array( - 'name' => 'Job title', + 'name' => 'Job title
    (Required)', 'id' => $prefix . 'job_title', 'type' => 'text', 'class' => 'job-title', From 88b563fc2b74afabd6ef418426b9f7e7364d2e5f Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Wed, 28 Feb 2024 12:11:09 -0500 Subject: [PATCH 068/209] content fix --- .../admin/class-phila-gov-staff-directory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php index 689036b9e6..2003aa11ab 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php @@ -68,7 +68,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'class' => 'last-name', ), array( - 'name' => 'Name Suffix
    (Optional)', + 'name' => 'Suffix
    (Optional)', 'id' => $prefix . 'name_suffix', 'type' => 'select', 'class' => 'name-suffix', From 68aec1d77a9e6bfa3e1914d29bf99f4120f6cd4b Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Thu, 7 Mar 2024 10:18:59 -0500 Subject: [PATCH 069/209] remove optional tags --- .../admin/class-phila-gov-staff-directory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php index 2003aa11ab..8d1b9a3632 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php @@ -68,7 +68,7 @@ function phila_register_meta_boxes( $meta_boxes ){ 'class' => 'last-name', ), array( - 'name' => 'Suffix
    (Optional)', + 'name' => 'Suffix', 'id' => $prefix . 'name_suffix', 'type' => 'select', 'class' => 'name-suffix', @@ -89,7 +89,7 @@ function phila_register_meta_boxes( $meta_boxes ){ ), ), array( - 'name' => 'Professional certification
    (Optional)', + 'name' => 'Professional certification', 'id' => $prefix . 'prof_cert', 'type' => 'text', ), From 04fff1b8ab26e9d6830d1c5c874815d54aa01791 Mon Sep 17 00:00:00 2001 From: Ritika Desai Date: Thu, 14 Mar 2024 15:45:38 -0400 Subject: [PATCH 070/209] FE changes --- .../admin/meta-boxes/class-phila-gov-post.php | 5 ++- .../class-phila-gov-standard-metaboxes.php | 8 ---- .../phila.gov-theme/css/scss/_card.scss | 2 +- .../themes/phila.gov-theme/css/scss/base.scss | 1 + .../css/scss/pages/_blog-post.scss | 17 +++++++++ .../phila.gov-theme/inc/breadcrumbs.php | 10 ++++- .../partials/posts/phila-series.php | 4 +- .../phila.gov-theme/templates/blog_post.php | 38 +++---------------- .../phila.gov-theme/templates/single-post.php | 2 +- 9 files changed, 38 insertions(+), 49 deletions(-) create mode 100644 wp/wp-content/themes/phila.gov-theme/css/scss/pages/_blog-post.scss diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php index 0385a98e31..68c6731961 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-post.php @@ -21,7 +21,8 @@ function register_meta_boxes_posts($meta_boxes){ 'visible' => array( 'when' => array( array('phila_template_select', '=', 'advanced_post'), - array('phila_template_select', '=', 'post') + array('phila_template_select', '=', 'post'), + array('phila_template_select', '=', 'series'), ), 'relation' => 'or' ), @@ -103,7 +104,7 @@ function register_meta_boxes_posts($meta_boxes){ $meta_boxes[] = array ( 'title' => 'Language options', - 'pages' => array( 'post', 'blog_post' ), + 'pages' => array( 'post' ), 'context' => 'side', 'priority' => 'high', 'visible' => array( diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index 6051df6332..b77f8a65c5 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1962,14 +1962,6 @@ public static function phila_adv_posts_options() ) ) ) - ), - array( - 'visible' => array('phila_adv_posts_select_options', '=', 'phila_series'), - 'id' => 'phila_adv_series', - 'type' => 'group', - 'fields' => array( - Phila_Gov_Standard_Metaboxes::phila_post_selector($multiple = false, $post_types = ['series']), - ), ) ) ); diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/_card.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/_card.scss index a3cabadd1d..4255a5a4bb 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/_card.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/_card.scss @@ -76,7 +76,7 @@ a.card, } } &.card--series{ - min-height:24rem; + min-height: 466px; &:not(.card--last){ border-bottom:5px solid #9400c6; } diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss index 7b8b1ed723..a317bf1566 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss @@ -52,6 +52,7 @@ @import 'pages/action-guide-v2'; @import 'pages/advanced-posts'; +@import 'pages/blog-post'; @import 'pages/collection-page'; @import 'pages/departments'; @import 'pages/documents'; diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_blog-post.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_blog-post.scss new file mode 100644 index 0000000000..31aa47b8ef --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_blog-post.scss @@ -0,0 +1,17 @@ + +.series{ + margin-bottom: 95px; + .card{ + width: 299px; + } + .series-img{ + width: 299px !important; + height: 209px !important; + } + h1{ + font-size: 20px; + } +} +.series.cell{ + margin-bottom: 1rem !important; +} \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/inc/breadcrumbs.php b/wp/wp-content/themes/phila.gov-theme/inc/breadcrumbs.php index f6b2791a4a..ff2dac53bc 100644 --- a/wp/wp-content/themes/phila.gov-theme/inc/breadcrumbs.php +++ b/wp/wp-content/themes/phila.gov-theme/inc/breadcrumbs.php @@ -15,7 +15,7 @@ function phila_breadcrumbs() { echo 'Home'; echo ''; //TODO: loop through template and apply $label_arr - if ( is_singular('post') ){ + if ( is_singular('post') || is_singular(('blog_post')) ){ echo '
  • The latest news + events
  • '; if( phila_get_selected_template( $post->ID ) == 'press_release' ) { echo '
  • Press releases
  • '; @@ -23,7 +23,13 @@ function phila_breadcrumbs() { echo '
  • Posts
  • '; }elseif ( phila_get_selected_template( $post->ID ) == 'action_guide' ) { echo '
  • Action guides
  • '; - }else { + }elseif ( phila_get_selected_template( $post->ID ) == 'advanced_post' ) { + echo '
  • Advanced Post
  • '; + }elseif ( phila_get_selected_template( $post->ID ) == 'series' ) { + echo '
  • Series
  • '; + } + + else { echo '
  • Featured
  • '; } echo '
  • '; diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php index 7065a30613..85ce7fe001 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/phila-series.php @@ -12,14 +12,14 @@ $post = get_post($row); $post_type = $post->post_type; ?> -
  • - = 2 ): ?> - - -
    - = 2 ): ?> - - -
    -
    -
    -
    -

    Action guides

    -
    - -
    -
    -
    From ec78a86dbb0174fd0df8f5dfea07628b58a68802 Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Fri, 18 Oct 2024 22:43:26 -0400 Subject: [PATCH 158/209] deregister extra front-end styles --- wp/wp-content/themes/phila.gov-theme/functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index 4e6504b83e..9fad3aea3e 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -128,6 +128,12 @@ function phila_filter_sep(){ } +/* DISABLE GUTENBERG STYLE IN HEADER| WordPress 5.9 */ +function deregister_styles() { + wp_dequeue_style( 'global-styles' ); +} +add_action( 'wp_enqueue_scripts', 'deregister_styles', 100 ); + /* Custom image sizes for responsive images */ add_filter( 'wp_calculate_image_sizes', 'phila_content_image_sizes_attr', 10 , 2 ); From c1df217f06590b3b8f4d21215c8c0bef24e0531d Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Fri, 18 Oct 2024 22:44:00 -0400 Subject: [PATCH 159/209] Use white text logo --- wp/wp-content/themes/phila.gov-theme/header.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/header.php b/wp/wp-content/themes/phila.gov-theme/header.php index 2508b39845..5b46250171 100644 --- a/wp/wp-content/themes/phila.gov-theme/header.php +++ b/wp/wp-content/themes/phila.gov-theme/header.php @@ -157,14 +157,14 @@
    -
    From 5df7d9d06589f0a70fef9e8fe2a05bfd583332fc Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Fri, 18 Oct 2024 23:47:17 -0400 Subject: [PATCH 160/209] Add update header for new design --- .../phila.gov-theme/css/scss/_layout.scss | 10 ++-- .../phila.gov-theme/css/scss/_sticky-nav.scss | 5 +- .../css/scss/base/_global-nav.scss | 48 +++++++++++-------- .../phila.gov-theme/css/scss/pages/_post.scss | 4 +- .../themes/phila.gov-theme/header.php | 35 +++++++------- .../phila.gov-theme/js/dev/phila-gov.js | 21 ++------ 6 files changed, 57 insertions(+), 66 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/_layout.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/_layout.scss index c5aa4a3008..99207e7564 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/_layout.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/_layout.scss @@ -6,10 +6,12 @@ h1 .fa{ font-size: 2rem; } } -//set explicit height on logo for IE10, 11 -#global-sticky-nav{ - .logo img{ - height:43px; + +.primary-menu{ + .menu-item-has-children{ + a{ + color:white; + } } } diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/_sticky-nav.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/_sticky-nav.scss index b8b9c0962d..f21dda9fe3 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/_sticky-nav.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/_sticky-nav.scss @@ -1,12 +1,13 @@ + .global-nav { + background: color(dark-ben-franklin); .phila-sticky { - background: white; + background: color(dark-ben-franklin); width: 100% !important; max-width: 100% !important; left: 0 !important; .sticky-header-width{ - max-width: 90rem; margin-left: auto; margin-right: auto; } diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss index f1ed4aab67..21cb8bcde6 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss @@ -15,7 +15,7 @@ ul { font-size: 14px; - + li.gov-site.show-for-medium { font-size: .85rem; @@ -95,10 +95,8 @@ background: color(ghost-gray); - - li { - + &:last-of-type::after { content: none; } @@ -148,7 +146,7 @@ } } } - + &.gov-site { span { @@ -198,7 +196,7 @@ pointer-events: none; } } - + .goog-te-combo { font-size: 1rem; } @@ -230,7 +228,7 @@ /* Styles for screens between 600px and 900px */ @media screen and (min-width: 780px) and (max-width: 950px) { - + #lang-dropdown { transform: translateX(-7%) !important; } @@ -332,7 +330,7 @@ color: white; background-color: color(dark-ben-franklin); } - + .fa { margin-right: 8px; } @@ -351,7 +349,7 @@ } .goog-te-gadget { - + position: relative; display: block; color: color(dark-ben-franklin); @@ -381,7 +379,7 @@ font-family: "Montserrat", "Tahoma", sans-serif; min-height: 42px; - @media screen and (max-width: 779px) { + @media screen and (max-width: 779px) { padding-left: 3.5rem; } @@ -504,20 +502,27 @@ } } + .icymi{ + a { + color: white; + font-family: 'Times New Roman', Times, serif; + font-style: italic; + font-size: 1.3rem; + } + } .menu-icon { position: relative; - min-width: 56px; - width: auto; - height: auto; + width: 70px; + height: 70px; padding: 1.3rem; margin-left: 0; - background: white; - color: color(dark-ben-franklin); + background: color(flyers-orange); + color: white; .fass { - font-size: 1.5rem; + font-size: 2rem; } .fa { @@ -671,7 +676,7 @@ .primary-menu { ul { - background-color: white; + background-color: color(dark-ben-franklin); } .menu { @@ -689,6 +694,7 @@ font-size: 14px; text-transform: none !important; padding: 2rem 1.7rem; + color: white; } a:active, @@ -918,7 +924,7 @@ } #services-list { - + // sass-lint:disable-line no-ids .inner-wrapper { width: 100%; @@ -962,7 +968,7 @@ } } - color:color(dark-ben-franklin); + color:white; text-transform: uppercase; } @@ -993,7 +999,7 @@ header { } .logo { display: block; - margin: 0.5rem auto !important; + margin: 0 auto !important; opacity: 1; transition: opacity .25s ease-in-out; -moz-transition: opacity .25s ease-in-out; @@ -1026,7 +1032,7 @@ header { width: 100px; display: inline-block; vertical-align: middle; - + .circle-icon { line-height: 1.5rem; align-items: center; diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_post.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_post.scss index 62f7290622..4a4f230d7f 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_post.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/pages/_post.scss @@ -227,7 +227,6 @@ .grid-container { padding-right: .71429rem; padding-left: .71429rem; - max-width: 75rem; } &.pam { padding: 1rem; @@ -251,13 +250,12 @@ } #global-sticky-nav { .sticky-header-width { - max-width: 75rem; .columns { margin-bottom: 0px; } } .phila-sticky { - background: white; + background: #0f4d90; width: 100% !important; max-width: 100% !important; left: 0 !important; diff --git a/wp/wp-content/themes/phila.gov-theme/header.php b/wp/wp-content/themes/phila.gov-theme/header.php index 5b46250171..9e62e1008c 100644 --- a/wp/wp-content/themes/phila.gov-theme/header.php +++ b/wp/wp-content/themes/phila.gov-theme/header.php @@ -66,7 +66,7 @@
    -
    +
    -
    -
    -
    -
    -
    -
    \ No newline at end of file From e9ece36c37a4d0c58419b7bb465643f91f7af72e Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Sat, 9 Nov 2024 10:03:50 -0500 Subject: [PATCH 182/209] Update twitter to it's new 'name' and add LinkedIn as an option --- .../admin/class-phila-gov-staff-directory.php | 4 +-- .../class-phila-gov-row-metaboxes.php | 24 ++++++++----- .../class-phila-gov-standard-metaboxes.php | 12 +++++-- ...s-phila-gov-service-register-templates.php | 14 +++++--- .../partials/content-phila-row.php | 28 +++++++-------- .../partials/posts/post-grid.php | 36 +++++++++++++++++++ 6 files changed, 86 insertions(+), 32 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php index b8c39020a9..b5231b298c 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/class-phila-gov-staff-directory.php @@ -132,10 +132,10 @@ function phila_register_meta_boxes( $meta_boxes ){ 'desc' => 'Example: https://www.facebook.com/PhiladelphiaCityGovernment/', ), array( - 'name' => 'Twitter URL', + 'name' => 'X URL', 'id' => $prefix . 'staff_twitter', 'type' => 'url', - 'desc' => 'Example: https://twitter.com/PhiladelphiaGov' + 'desc' => 'Example: https://x.com/PhiladelphiaGov' ), array( 'name' => 'Instagram URL', diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php index c5964d62ec..67f500fd8c 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php @@ -278,13 +278,13 @@ public static function phila_metabox_full_options( ){ 'context' => 'normal', 'priority' => 'default', 'type' => 'group', - + 'visible' => array( 'when' => array( array( 'phila_full_options_select', '=', 'phila_staff_table'), ), ), - + 'fields' => array( array( 'id' => 'phila_staff_directory_selected', @@ -345,7 +345,7 @@ public static function phila_metabox_full_options( ){ 'type' => 'group', 'clone' => false, 'visible' => array('phila_full_options_select', '=', 'phila_programs'), - 'fields' => + 'fields' => Phila_Gov_Standard_Metaboxes::phila_program_page_selector($multiple = true) ), array( @@ -702,10 +702,16 @@ public static function phila_metabox_heading_group( ){ 'desc' => 'Example: https://www.facebook.com/PhiladelphiaCityGovernment/', ), array( - 'name' => 'Twitter URL', + 'name' => 'X URL', 'id' => 'phila_connect_social_twitter', 'type' => 'url', - 'desc' => 'Example: https://twitter.com/PhiladelphiaGov' + 'desc' => 'Example: https://x.com/PhiladelphiaGov' + ), + array( + 'name' => 'LinkedIn URL', + 'id' => 'phila_connect_social_linkedin', + 'type' => 'url', + 'desc' => 'Example: https://www.linkedin.com/company/city-of-philadelphia/' ), array( 'name' => 'Instagram URL', @@ -747,7 +753,7 @@ public static function phila_metabox_heading_group( ){ 'fields' => array( Phila_Gov_Standard_Metaboxes::phila_metabox_v2_ordered_content(), - + ) ), ); @@ -769,9 +775,9 @@ public static function phila_metabox_faq( ){ 'add_button' => '+ Add FAQ', 'fields' => array( Phila_Gov_Standard_Metaboxes::phila_metabox_double_wysiwyg( - $section_name = 'FAQ title', - $wysiwyg_desc = 'FAQ content', - $columns = 12, + $section_name = 'FAQ title', + $wysiwyg_desc = 'FAQ content', + $columns = 12, $clone = true ), ) ) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index f685feb8ba..f52b277c19 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -148,10 +148,16 @@ public static function phila_metabox_v2_address_fields_unique($group_id = 'phila 'desc' => 'Example: https://www.facebook.com/PhiladelphiaCityGovernment/', ), array( - 'name' => 'Twitter URL', + 'name' => 'X URL', 'id' => 'phila_connect_social_twitter', 'type' => 'url', - 'desc' => 'Example: https://twitter.com/PhiladelphiaGov' + 'desc' => 'Example: https://x.com/PhiladelphiaGov' + ), + array( + 'name' => 'LinkedIn URL', + 'id' => 'phila_connect_social_linkedin', + 'type' => 'url', + 'desc' => 'Example: https://www.linkedin.com/company/city-of-philadelphia/' ), array( 'name' => 'Instagram URL', @@ -1300,7 +1306,7 @@ public static function phila_meta_var_member_list ($id = 'phila_commission_membe 'add_button' => '+ Add member', 'fields' => array( array( - 'id' => 'full_name', + 'id' => 'full_name', 'name' => 'Full name', 'type' => 'text', 'desc' => 'Enter the full name, with honorific e.g.: Dr. Herbert West, PhD' diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-service-register-templates.php b/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-service-register-templates.php index 09555b1de6..4df09bf895 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-service-register-templates.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/service-page/class-phila-gov-service-register-templates.php @@ -34,7 +34,7 @@ function register_template_selection_metabox_services( $meta_boxes ){ 'id' => 'phila_start_process', 'type' => 'group', 'clone' => false, - + 'fields' => array( array( 'id' => 'phila_wysiwyg_process_content', @@ -69,7 +69,7 @@ function register_template_selection_metabox_services( $meta_boxes ){ Phila_Gov_Standard_Metaboxes::phila_metabox_v2_link_fields('Button details', 'phila_start_button'), ) ); - + $meta_boxes[] = array( 'id' => 'service_questions', @@ -181,10 +181,16 @@ function register_template_selection_metabox_services( $meta_boxes ){ 'desc' => 'Example: https://www.facebook.com/PhiladelphiaCityGovernment/', ), array( - 'name' => 'Twitter URL', + 'name' => 'X URL', 'id' => 'phila_connect_social_twitter', 'type' => 'url', - 'desc' => 'Example: https://twitter.com/PhiladelphiaGov' + 'desc' => 'Example: https://x.com/PhiladelphiaGov' + ), + array( + 'name' => 'LinkedIn URL', + 'id' => 'phila_connect_social_linkedin', + 'type' => 'url', + 'desc' => 'Example: https://www.linkedin.com/company/city-of-philadelphia/' ), array( 'name' => 'Instagram URL', diff --git a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php index 14da4b4f9c..54f135e9e7 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php @@ -1,6 +1,6 @@ -
    +
    @@ -46,7 +46,7 @@ $cal_id = isset( $current_row['phila_full_options']['phila_full_width_calendar']['phila_full_width_calendar_id'] ) ? $current_row['phila_full_options']['phila_full_width_calendar']['phila_full_width_calendar_id'] : null; $spotlight_id = isset( $current_row['phila_full_options']['phila_full_width_calendar']['phila_event_spotlight'] ) ? $current_row['phila_full_options']['phila_full_width_calendar']['phila_event_spotlight'] : ''; $display_spotlight = isset( $current_row['phila_full_options']['phila_full_width_calendar']['phila_active_event_spotlight'] ) ? $current_row['phila_full_options']['phila_full_width_calendar']['phila_active_event_spotlight'] : null; - $cal_owner_id = isset( $current_row['phila_full_options']['phila_full_width_calendar']['phila_calendar_owner'] ) ? $current_row['phila_full_options']['phila_full_width_calendar']['phila_calendar_owner'] : ''; + $cal_owner_id = isset( $current_row['phila_full_options']['phila_full_width_calendar']['phila_calendar_owner'] ) ? $current_row['phila_full_options']['phila_full_width_calendar']['phila_calendar_owner'] : ''; ?> @@ -69,7 +69,7 @@ -
    @@ -214,7 +214,7 @@ - + - + @@ -301,7 +301,7 @@ - @@ -310,7 +310,7 @@ - @@ -325,7 +325,7 @@ - diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php index 0dcc3cb9c7..c3b7a3302e 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php @@ -235,3 +235,39 @@
    + \ No newline at end of file From f0bbcf16355bd5b64f2071149ce51b1f39231a52 Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Sat, 9 Nov 2024 12:06:06 -0500 Subject: [PATCH 183/209] Add toggle for new blog design --- .../class-phila-gov-row-metaboxes.php | 8 + .../class-phila-gov-standard-metaboxes.php | 10 +- .../css/scss/{ => 2024-refresh}/_mayor.scss | 1 - .../css/scss/2024-refresh/_news.scss | 53 ++++ .../themes/phila.gov-theme/css/scss/base.scss | 3 +- .../themes/phila.gov-theme/functions.php | 2 + .../partials/content-phila-row.php | 5 +- .../departments/phila_full_row_blog.php | 16 +- .../departments/v2/content-one-quarter.php | 12 +- .../partials/global/contact-information.php | 12 +- .../partials/posts/post-grid.php | 255 +++++++++--------- 11 files changed, 240 insertions(+), 137 deletions(-) rename wp/wp-content/themes/phila.gov-theme/css/scss/{ => 2024-refresh}/_mayor.scss (99%) create mode 100644 wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php index 67f500fd8c..10c26849c3 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php @@ -85,6 +85,14 @@ public static function phila_metabox_full_options( ){ ), 'fields' => array( Phila_Gov_Row_Select_Options::phila_metabox_full_options_select(), + array( + 'name' => '2024 updated design', + 'id' => '2024_updated_design', + 'type' => 'switch', + 'desc' => 'Use updated 2024 design?', + 'on_label' => 'Yes', + 'off_label' => 'No', + ), array( 'visible' => array('phila_full_options_select', '=', 'phila_blog_posts'), 'id' => 'phila_get_post_cats', diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index f52b277c19..7ff1e73c26 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -1156,10 +1156,16 @@ public static function phila_meta_var_connect(){ 'desc' => 'Example: https://www.facebook.com/PhiladelphiaCityGovernment/', ), array( - 'name' => 'Twitter URL', + 'name' => 'X URL', 'id' => 'phila_connect_social_twitter', 'type' => 'url', - 'desc' => 'Example: https://twitter.com/PhiladelphiaGov' + 'desc' => 'Example: https://x.com/PhiladelphiaGov' + ), + array( + 'name' => 'LinkedIn URL', + 'id' => 'phila_connect_social_linkedin', + 'type' => 'url', + 'desc' => 'Example: https://www.linkedin.com/company/city-of-philadelphia/' ), array( 'name' => 'Instagram URL', diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/_mayor.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_mayor.scss similarity index 99% rename from wp/wp-content/themes/phila.gov-theme/css/scss/_mayor.scss rename to wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_mayor.scss index 328cefbcee..07cf98bcbf 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/_mayor.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_mayor.scss @@ -51,5 +51,4 @@ background-color: white; } } - } \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss new file mode 100644 index 0000000000..8f469a8d47 --- /dev/null +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss @@ -0,0 +1,53 @@ + + .featured { + background-color: #f0f0f0; + padding: 3rem 0 5rem 0; + + hr { + + margin: 0 auto; + border: 5px solid #2176d2; + } + .featured-grid { + margin: 0 auto !important; + + .featured-content{ + background-color: white; + padding-left: 1.5rem; + } + .date-published { + color: #444; + } + .featured-item { + margin: 3rem 0; + } + + .post-label { + font-family: "Times New Roman Italic", "Times New Roman", sans-serif; + font-style: italic; + color: #0f4d90; + font-size: 30px; + } + img { + max-width: auto; + width: 100%; + } + + a.faux-card:hover { + cursor: pointer; + + img{ + opacity: .4; + } + .featured-content { + background-color: #0f4d90; + } + .post-label { + color: #fff; + } + .date-published { + color: #fff; + } + } + } + } \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss index 98cca87437..8d8305aa9a 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/base.scss @@ -27,7 +27,6 @@ @import 'lightbox'; @import 'location-list'; @import 'maps'; -@import 'mayor'; @import 'modal'; @import 'panel'; @import 'resource-list'; @@ -41,6 +40,8 @@ @import 'timeline'; @import 'walk-ins'; +@import '2024-refresh/mayor'; +@import '2024-refresh/news'; @import 'modules/hero-full'; @import 'modules/hero-header'; diff --git a/wp/wp-content/themes/phila.gov-theme/functions.php b/wp/wp-content/themes/phila.gov-theme/functions.php index aeda94a89b..ff02c2856b 100644 --- a/wp/wp-content/themes/phila.gov-theme/functions.php +++ b/wp/wp-content/themes/phila.gov-theme/functions.php @@ -1531,6 +1531,8 @@ function phila_connect_panel($connect_panel) { if ( isset( $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_twitter'] ) && $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_twitter'] != '' ) $output_array['social']['twitter'] = $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_twitter']; + if ( isset( $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_linkedin'] ) && $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_linkedin'] != '' ) $output_array['social']['linkedin'] = $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_linkedin']; + if ( isset( $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_instagram'] ) && $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_instagram'] != '' ) $output_array['social']['instagram'] = $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_instagram']; if ( isset( $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_youtube'] ) && $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_youtube'] != '' ) $output_array['social']['youtube'] = $connect_panel['phila_connect_general']['phila_connect_social']['phila_connect_social_youtube']; diff --git a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php index 54f135e9e7..4b7c077bbe 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php @@ -28,8 +28,11 @@ if ( $current_row_option == 'phila_blog_posts'):?> -
    +
    + + + diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_full_row_blog.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_full_row_blog.php index a0fdb9ac15..ce713c508b 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_full_row_blog.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/phila_full_row_blog.php @@ -12,7 +12,7 @@ $slang_name = phila_get_owner_typography( $categories[0] ); } - if ( empty($blog_see_all) ) : + if ( empty($blog_see_all) ) : $blog_see_all = ''; endif; @@ -36,15 +36,15 @@ endif; ?> -
    - + 'Posts', 'tag' => $blog_tag_override, 'see_all' => $blog_see_all ); - + if (isset($blog_cat_override[0])){ $category = array($blog_cat_override[0]); } else { @@ -54,17 +54,17 @@ array_push($category, $cat->term_id); } } - + if ( !empty($a['tag'] ) ){ $tag = explode(',', $a['tag']); } - + if ( !empty($a['see_all']) ){ $override_url = $a['see_all']; } - + include( locate_template( 'partials/posts/post-grid.php' ) ); - + wp_reset_postdata(); ?>
    diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-one-quarter.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-one-quarter.php index 03513312c8..1a7d623ced 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-one-quarter.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-one-quarter.php @@ -108,11 +108,13 @@ $email_desc = isset( $content['phila_std_address']['phila_connect_general']['phila_connect_email_exp'] ) ? $content['phila_std_address']['phila_connect_general']['phila_connect_email_exp'] : ''; $fax = isset( $content['phila_std_address']['phila_connect_general']['phila_connect_fax'] ) ? $content['phila_std_address']['phila_connect_general']['phila_connect_fax'] : ''; - + $facebook = isset( $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_facebook'] ) ? $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_facebook'] : ''; $twitter = isset( $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_twitter'] ) ? $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_twitter'] : ''; + $linkedin = isset( $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_linkedin'] ) ? $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_linkedin'] : ''; + $instagram = isset( $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_instagram'] ) ? $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_instagram'] : ''; $youtube = isset( $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_youtube'] ) ? $content['phila_std_address']['phila_connect_general']['phila_connect_social']['phila_connect_social_youtube'] : ''; @@ -170,6 +172,14 @@ + + + + + LinkedIn + + + diff --git a/wp/wp-content/themes/phila.gov-theme/partials/global/contact-information.php b/wp/wp-content/themes/phila.gov-theme/partials/global/contact-information.php index efbe9f3e0e..ee31750940 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/global/contact-information.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/global/contact-information.php @@ -1,5 +1,5 @@ + + + + + LinkedIn + + + diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php index c3b7a3302e..72148cec6b 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php @@ -1,10 +1,11 @@ -
    -
    - have_posts() ) : ?> - -
    - post_count; ?> - - have_posts() ) : $result->the_post(); ?> - - - - -
    - -
    - - = 3 ): ?> - -
    - - -
    - - + + + +
    +
    +
    + have_posts() ) : ?> + +
    + post_count; ?> + + have_posts() ) : $result->the_post(); ?> + + + + +
    + +
    + + = 3 ): ?> + +
    + + +
    + + +
    +
    +
    +
    + +
    +
    +
    -
    -
    -
    + +
    -
    - -
    - -
    - -
    - - - - = 3 ): ?> -
    - '/the-latest/archives/?templates=post&templates=featured', - 'content_type' => $label, - 'nice_name' => 'posts' - ); ?> - - '/the-latest/archives/?templates=post&templates=featured&department=' . $slang_name, - ); - $see_all = array_replace( $see_all, $see_all_URL ); - endif;?> - name); - } - $term = implode(', ', $term); - $see_all_URL = array( - 'URL' => '/the-latest/archives/?tag=' . $term, - ); - else: - $term = get_term($tag, 'post_tag'); - $see_all_URL = array( - 'URL' => '/the-latest/archives/?tag=' . $term->name, - ); - endif; ?> - - $override_url - ); ?> - - + + + = 3 ): ?> +
    + '/the-latest/archives/?templates=post&templates=featured', + 'content_type' => $label, + 'nice_name' => 'posts' + ); ?> + + '/the-latest/archives/?templates=post&templates=featured&department=' . $slang_name, + ); + $see_all = array_replace( $see_all, $see_all_URL ); endif;?> - -
    -
    - -
    - - - -
    - - - -
    - + + +
    +
    -
    \ No newline at end of file + + From 14bfd2e8bd66fd32e242b4584020c2c218b8073e Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Sat, 9 Nov 2024 12:21:52 -0500 Subject: [PATCH 184/209] Finish adding linkedin --- .../partials/departments/v2/content-connect.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-connect.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-connect.php index d4dddc167f..0d853bd19d 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-connect.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/content-connect.php @@ -90,9 +90,9 @@ $co_code = ( $phone_multi['co-code'] != '' ) ? $phone_multi['co-code'] : ''; $subscriber_number = ( $phone_multi['subscriber-number'] != '' ) ? '-' . $phone_multi['subscriber-number'] : ''; - + $phone_text_2 = ($phone_multi['helper-text'] != '') ? $phone_multi['helper-text'] : ''; - + $full_phone_2 = $area . $co_code . $subscriber_number; ?> @@ -150,6 +150,14 @@
    + + +
    From 3c5f198faa9348d23be332a88eb178dcf2e3a0fe Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Sat, 9 Nov 2024 13:26:10 -0500 Subject: [PATCH 185/209] New rendering for press releases --- .../class-phila-gov-row-metaboxes.php | 88 ++++++++++--------- .../class-phila-gov-row-select-options.php | 4 +- .../css/scss/2024-refresh/_news.scss | 23 +++++ .../partials/content-phila-row.php | 8 +- .../partials/posts/press-release-grid.php | 33 ++++++- .../shortcodes/press-releases.php | 6 +- 6 files changed, 114 insertions(+), 48 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php index 10c26849c3..862d35b91f 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php @@ -85,19 +85,19 @@ public static function phila_metabox_full_options( ){ ), 'fields' => array( Phila_Gov_Row_Select_Options::phila_metabox_full_options_select(), - array( - 'name' => '2024 updated design', - 'id' => '2024_updated_design', - 'type' => 'switch', - 'desc' => 'Use updated 2024 design?', - 'on_label' => 'Yes', - 'off_label' => 'No', - ), array( 'visible' => array('phila_full_options_select', '=', 'phila_blog_posts'), 'id' => 'phila_get_post_cats', 'type' => 'group', 'fields' => array( + array( + 'name' => '2024 updated design', + 'id' => '2024_updated_design', + 'type' => 'switch', + 'desc' => 'Use updated 2024 design?', + 'on_label' => 'Yes', + 'off_label' => 'No', + ), Phila_Gov_Standard_Metaboxes::phila_metabox_category_picker('Select new owner', 'phila_post_category', 'Display posts from these owners.' ), array( 'name' => 'Filter by a tag', @@ -262,6 +262,14 @@ public static function phila_metabox_full_options( ){ 'type' => 'group', 'visible' => array('phila_full_options_select', '=', 'phila_full_width_press_releases'), 'fields' => array( + array( + 'name' => '2024 updated design', + 'id' => '2024_updated_design', + 'type' => 'switch', + 'desc' => 'Use updated 2024 design?', + 'on_label' => 'Yes', + 'off_label' => 'No', + ), Phila_Gov_Standard_Metaboxes::phila_metabox_category_picker('Select owners', 'phila_press_release_category', 'Display press releases from these owners.' ), array( 'name' => 'Filter by a tag', @@ -434,50 +442,50 @@ public static function phila_metabox_full_options( ){ 'visible' => array('phila_full_options_select', '=', 'phila_photo_callout'), 'fields' => Phila_Gov_Row_Metaboxes::phila_metabox_photo_callout() ), - array( - 'id' => 'faq', - 'type' => 'group', - 'visible' => array('phila_full_options_select', '=', 'phila_faq'), - 'fields' => Phila_Gov_Row_Metaboxes::phila_metabox_faq() - ), + // array( + // 'id' => 'faq', + // 'type' => 'group', + // 'visible' => array('phila_full_options_select', '=', 'phila_faq'), + // 'fields' => Phila_Gov_Row_Metaboxes::phila_metabox_faq() + // ), array( 'id' => 'phila_content_heading_group', 'type' => 'group', 'visible' => array('phila_full_options_select', '=', 'phila_content_heading_group'), 'fields' => Phila_Gov_Row_Metaboxes::phila_metabox_heading_group() ), - array( - 'id' => 'phila_prereq', - 'type' => 'group', - 'visible' => array('phila_full_options_select', '=', 'phila_prereq'), - 'fields' => Phila_Gov_Standard_Metaboxes::phila_meta_prereq_row('Prerequisite row title') - ), + // array( + // 'id' => 'phila_prereq', + // 'type' => 'group', + // 'visible' => array('phila_full_options_select', '=', 'phila_prereq'), + // 'fields' => Phila_Gov_Standard_Metaboxes::phila_meta_prereq_row('Prerequisite row title') + // ), array( 'id' => 'phila_content_additional_content', 'type' => 'group', 'visible' => array('phila_full_options_select', '=', 'phila_content_additional_content'), 'fields' => Phila_Gov_Standard_Metaboxes::phila_meta_var_addtional_content() ), - array( - 'id' => 'phila_service_update_page', - 'type' => 'group', - 'visible' => array('phila_full_options_select', '=', 'phila_service_updates'), - 'fields' => Phila_Gov_Standard_Metaboxes::phila_get_service_updates(), - ), - array( - 'id' => 'phila_timeline_picker', - 'type' => 'group', - 'visible' => array('phila_full_options_select', '=', 'phila_homepage_timeline'), - 'fields' => array( - Phila_Gov_Standard_Metaboxes::phila_timeline_page_selector(), - array( - 'name' => 'Timeline item count', - 'id' => 'homepage_timeline_item_count', - 'desc' => 'Select the number of items from the timeline to display', - 'type' => 'number' - ), - ) - ), + // array( + // 'id' => 'phila_service_update_page', + // 'type' => 'group', + // 'visible' => array('phila_full_options_select', '=', 'phila_service_updates'), + // 'fields' => Phila_Gov_Standard_Metaboxes::phila_get_service_updates(), + // ), + // array( + // 'id' => 'phila_timeline_picker', + // 'type' => 'group', + // 'visible' => array('phila_full_options_select', '=', 'phila_homepage_timeline'), + // 'fields' => array( + // Phila_Gov_Standard_Metaboxes::phila_timeline_page_selector(), + // array( + // 'name' => 'Timeline item count', + // 'id' => 'homepage_timeline_item_count', + // 'desc' => 'Select the number of items from the timeline to display', + // 'type' => 'number' + // ), + // ) + // ), array( 'id' => 'phila_modal', 'type' => 'group', diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-select-options.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-select-options.php index 2c643bcbca..947d5936c0 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-select-options.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-select-options.php @@ -45,7 +45,7 @@ public static function phila_metabox_full_options_select(){ 'phila_custom_text' => 'Custom text', 'phila_custom_text_multi' => 'Custom text (multiple)', 'phila_faq' => 'FAQ', - 'phila_prereq' => 'FAQ list with icon (prereq approval style)', + //'phila_prereq' => 'FAQ list with icon (prereq approval style)', 'phila_feature_p_i' => 'Featured page content', 'phila_get_involved' => 'Get Involved', 'phila_image_list' => 'Image list', @@ -87,7 +87,7 @@ public static function phila_metabox_thirds_options( ){ ), ); } - + public static function phila_metabox_tabbed_select(){ return array( 'id' => 'phila_tabbed_select', diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss index 8f469a8d47..dfd97ad554 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss @@ -50,4 +50,27 @@ } } } + } + + a.press-release{ + background-color: color(ghost-gray); + font-size: 2rem; + margin: 3rem 0; + padding: 2rem; + display: block; + text-decoration: none; + + + h3{ + font-style: italic; + margin-bottom: 1rem; + + } + .post-meta { + color: #444; + } + + .fa { + font-size: 5rem; + } } \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php index 4b7c077bbe..34a77d2eaa 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php @@ -31,7 +31,7 @@ +
    + + +
    + + +
    ">
    have_posts() ) : ?> @@ -116,3 +142,4 @@
    + \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/shortcodes/press-releases.php b/wp/wp-content/themes/phila.gov-theme/shortcodes/press-releases.php index ab6ced5897..601f5a2627 100644 --- a/wp/wp-content/themes/phila.gov-theme/shortcodes/press-releases.php +++ b/wp/wp-content/themes/phila.gov-theme/shortcodes/press-releases.php @@ -14,7 +14,8 @@ function press_release_shortcode($atts) { 'name' => 'Press releases', 'category' => '', 'tag' => '', - 'see_all' => '' + 'see_all' => '', + 'use_2024_design' => '' ), $atts ); $category = array(); @@ -35,6 +36,9 @@ function press_release_shortcode($atts) { if ( !empty($a['see_all']) ){ $override_url = $a['see_all']; } + if ( !empty($a['use_2024_design']) ){ + $use_2024_design = $a['use_2024_design']; + } include( locate_template( 'partials/posts/press-release-grid.php' ) ); From dd0fc2582b9d87344b61ea858b9e313c74501870 Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Sat, 9 Nov 2024 13:32:50 -0500 Subject: [PATCH 186/209] Wrap up styles --- .../phila.gov-theme/css/scss/2024-refresh/_news.scss | 9 ++++++--- .../partials/posts/press-release-grid.php | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss index dfd97ad554..dddfb688da 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss @@ -26,7 +26,7 @@ font-family: "Times New Roman Italic", "Times New Roman", sans-serif; font-style: italic; color: #0f4d90; - font-size: 30px; + font-size: 2rem; } img { max-width: auto; @@ -59,15 +59,18 @@ padding: 2rem; display: block; text-decoration: none; + font-family: 'Times New Roman', Times, serif; + font-weight: 400; - - h3{ + p{ font-style: italic; margin-bottom: 1rem; + font-size: 2rem; } .post-meta { color: #444; + font-weight: 400; } .fa { diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/press-release-grid.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/press-release-grid.php index 79513c0753..e16431f25a 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/press-release-grid.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/press-release-grid.php @@ -79,13 +79,13 @@

    Press releases


    have_posts() ) : $result->the_post(); ?> - ">
    From 7adac2b7ac66d1135fa64aaf8e1b0c9a8e1c0a31 Mon Sep 17 00:00:00 2001 From: Moh Atia Date: Tue, 12 Nov 2024 15:33:31 -0500 Subject: [PATCH 187/209] update package --- scripts/composer.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/composer.sh b/scripts/composer.sh index 1b95d2033c..f644d7ff40 100644 --- a/scripts/composer.sh +++ b/scripts/composer.sh @@ -74,7 +74,8 @@ echo ' "wpackagist-plugin/wordpress-importer":"^0.8", "wpackagist-plugin/tinymce-advanced":"^5.9.2", "nesbot/carbon": "^2.64", - "google/apiclient": "^2.13" + "google/apiclient": "^2.13", + "wpackagist-plugin/litespeed-cache": "^6.5.2" }, "config": { "allow-plugins": { From 048e0634845c430053802a8f8dc180c9124149de Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Wed, 13 Nov 2024 14:59:27 -0500 Subject: [PATCH 188/209] Move 2024 toggle --- .../admin/meta-boxes/class-phila-gov-row-metaboxes.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php index 862d35b91f..0d5780a159 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php @@ -262,14 +262,6 @@ public static function phila_metabox_full_options( ){ 'type' => 'group', 'visible' => array('phila_full_options_select', '=', 'phila_full_width_press_releases'), 'fields' => array( - array( - 'name' => '2024 updated design', - 'id' => '2024_updated_design', - 'type' => 'switch', - 'desc' => 'Use updated 2024 design?', - 'on_label' => 'Yes', - 'off_label' => 'No', - ), Phila_Gov_Standard_Metaboxes::phila_metabox_category_picker('Select owners', 'phila_press_release_category', 'Display press releases from these owners.' ), array( 'name' => 'Filter by a tag', From da7a4ba069e289d716ae8c6e45381aabebc2c23e Mon Sep 17 00:00:00 2001 From: Karissa Demi Date: Mon, 18 Nov 2024 21:38:09 -0500 Subject: [PATCH 189/209] Clean up mayor's styles --- .../class-phila-gov-row-metaboxes.php | 8 ++ .../class-phila-gov-standard-metaboxes.php | 8 ++ .../css/scss/2024-refresh/_mayor.scss | 84 ++++++++++- .../css/scss/2024-refresh/_news.scss | 136 ++++++++++-------- .../css/scss/base/_global-nav.scss | 1 + .../partials/content-phila-row.php | 3 + .../phila_call_to_action_multi.php | 103 +++++++++---- .../partials/departments/v2/mayor/home.php | 2 +- .../partials/posts/post-grid.php | 3 +- .../partials/posts/press-release-grid.php | 7 +- 10 files changed, 258 insertions(+), 97 deletions(-) diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php index 0d5780a159..862d35b91f 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-row-metaboxes.php @@ -262,6 +262,14 @@ public static function phila_metabox_full_options( ){ 'type' => 'group', 'visible' => array('phila_full_options_select', '=', 'phila_full_width_press_releases'), 'fields' => array( + array( + 'name' => '2024 updated design', + 'id' => '2024_updated_design', + 'type' => 'switch', + 'desc' => 'Use updated 2024 design?', + 'on_label' => 'Yes', + 'off_label' => 'No', + ), Phila_Gov_Standard_Metaboxes::phila_metabox_category_picker('Select owners', 'phila_press_release_category', 'Display press releases from these owners.' ), array( 'name' => 'Filter by a tag', diff --git a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php index 7ff1e73c26..4ef9a70b7b 100644 --- a/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php +++ b/wp/wp-content/plugins/phila.gov-customization/admin/meta-boxes/class-phila-gov-standard-metaboxes.php @@ -944,6 +944,14 @@ public static function phila_meta_var_call_to_action_multi (){ 'id' => 'phila_call_to_action_section', 'type' => 'group', 'fields' => array( + array( + 'name' => '2024 updated design', + 'id' => '2024_updated_design', + 'type' => 'switch', + 'desc' => 'Use updated 2024 design?', + 'on_label' => 'Yes', + 'off_label' => 'No', + ), array( 'name' => 'Section Title', 'id' => 'phila_action_section_title_multi', diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_mayor.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_mayor.scss index 07cf98bcbf..aa57944627 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_mayor.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_mayor.scss @@ -13,6 +13,9 @@ .mr-meeseeks { h1 { font-size: 3rem; + @include breakpoint(medium down) { + font-size: 2rem; + } } span.MAYOR { display: block; @@ -20,18 +23,28 @@ font-size: 5rem; line-height: 4rem; font-weight: 700; + @include breakpoint(medium down) { + font-size: 3rem; + line-height: 3rem; + } } .tagline { font-size: 2rem; font-style: italic; font-family: 'Times New Roman', Times, serif; + @include breakpoint(medium down) { + font-size: 1.5rem; + } + } + @include breakpoint(medium down) { + text-align: center; } } - .what-we-do, .contrast { + #what-we-do, .connect-box .contrast { display: none; } .custom-text{ - p{ + p, ul, li{ font-size: 1.2rem; } } @@ -39,7 +52,7 @@ font-size: 1.4rem !important; th, td{ - padding: 0; + padding: 0 0 2rem 0; } div { font-size: 1.4rem !important; @@ -51,4 +64,69 @@ background-color: white; } } + .cta-multi{ + padding: 0; + margin: 0; + a.color-block-card{ + display: block; + font-family: 'Times New Roman', Times, serif; + font-style: italic; + padding: 4rem 1rem 4rem 4rem; + text-decoration: none; + @include breakpoint(medium down) { + text-align: center; + padding: 2rem; + } + .copy { + font-size: 2.5rem; + line-height: 3rem; + } + } + .cell:nth-child(1) { + background: color(electric-blue) !important; + a{ + color: #444; + &:hover{ + color: white + } + } + } + .cell:nth-child(2) { + background: color(flyers-orange)!important; + a{ + color: #444; + &:hover{ + color: white + } + } + } + .cell:nth-child(3) { + background: color(ben-franklin-blue) !important; + a { + color: white; + &:hover{ + color: #444; + } + } + } + .cell:nth-child(4) { + background: color(dark-ben-franklin) !important; + a { + color: white; + &:hover{ + color: #444; + } + } + } + } + h2 { + font-family: Montserrat-Bold,Montserrat Bold,Montserrat,sans-serif; + font-size: 3.75rem; + line-height: 4rem; + font-weight: 700; + @include breakpoint(medium down) { + font-size: 2.75rem; + line-height: 2.75rem; + } + } } \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss index dddfb688da..91fdd8ba5e 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/2024-refresh/_news.scss @@ -1,79 +1,95 @@ +.featured { + background-color: #f0f0f0; + padding: 3rem 0 5rem 0; - .featured { - background-color: #f0f0f0; - padding: 3rem 0 5rem 0; + hr { - hr { + margin: 0 auto; + border: 5px solid #2176d2; + } + .featured-grid { + margin: 0 auto !important; - margin: 0 auto; - border: 5px solid #2176d2; + .featured-content{ + background-color: white; + padding-left: 1.5rem; + } + .date-published { + color: #444; + font-family: "Open Sans", Helvetica, Roboto, Arial, sans-serif; + font-size: 1.2rem; + } + .featured-item { + margin: 3rem 0; } - .featured-grid { - margin: 0 auto !important; - .featured-content{ - background-color: white; - padding-left: 1.5rem; - } - .date-published { - color: #444; + .post-label { + font-family: "Times New Roman Italic", "Times New Roman", sans-serif; + font-style: italic; + color: #0f4d90; + font-size: 2rem; + } + img { + max-width: auto; + width: 100%; + } + + a.faux-card:hover { + cursor: pointer; + + img{ + opacity: .4; } - .featured-item { - margin: 3rem 0; + .featured-content { + background-color: #0f4d90; } - .post-label { - font-family: "Times New Roman Italic", "Times New Roman", sans-serif; - font-style: italic; - color: #0f4d90; - font-size: 2rem; - } - img { - max-width: auto; - width: 100%; + color: #fff; } - - a.faux-card:hover { - cursor: pointer; - - img{ - opacity: .4; - } - .featured-content { - background-color: #0f4d90; - } - .post-label { - color: #fff; - } - .date-published { - color: #fff; - } + .date-published { + color: #fff; } } } +} - a.press-release{ - background-color: color(ghost-gray); - font-size: 2rem; - margin: 3rem 0; - padding: 2rem; - display: block; - text-decoration: none; - font-family: 'Times New Roman', Times, serif; - font-weight: 400; +a.press-release{ + background-color: color(ghost-gray); + font-size: 2rem; + margin: 3rem 0; + padding: 2rem 0; + display: block; + text-decoration: none; + font-family: 'Times New Roman', Times, serif; + font-weight: 400; - p{ - font-style: italic; - margin-bottom: 1rem; - font-size: 2rem; + @include breakpoint(medium down) { + padding: 1rem 0; + margin: 2rem 0; + } - } + &:hover{ + background-color: color(ben-franklin-blue); + color: white !important; .post-meta { - color: #444; - font-weight: 400; + color: white; } + } - .fa { - font-size: 5rem; + p{ + font-style: italic; + margin-bottom: 1rem; + font-size: 2rem; + @include breakpoint(medium down) { + font-size: 1.5rem; } - } \ No newline at end of file + } + .post-meta { + color: #444; + font-weight: 400; + } + + .fa { + font-size: 5rem; + } +} \ No newline at end of file diff --git a/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss b/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss index cd06d39c00..4ead66730e 100644 --- a/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss +++ b/wp/wp-content/themes/phila.gov-theme/css/scss/base/_global-nav.scss @@ -668,6 +668,7 @@ @media screen and (min-width: 750px) and (max-width: 880px) { a.icymi { width:100px; + font-size: .8rem; } } diff --git a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php index 34a77d2eaa..ae92a32af5 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/content-phila-row.php @@ -135,7 +135,10 @@ +
    - if ( ! empty( $action_panel_section ) ) : ?> - - - -
    -
    -

    >

    -
    - + + + + +
    + +
    +

    +
    + +
    + + + - $action_panel_link = isset( $call_to_action['phila_action_panel_link_multi'] ) ? $call_to_action['phila_action_panel_link_multi'] : ''; +
    +
    + +
    +
    - $action_panel_link_loc = isset( $call_to_action['phila_action_panel_link_loc_multi'] ) ? $call_to_action['phila_action_panel_link_loc_multi'] : ''; + $link_url, + 'content_type' => $action_panel_title, + 'nice_name' => $action_panel_title + );?> + +
    +
    + - $action_panel_fa = isset( $call_to_action['phila_action_panel_fa_multi'] ) ? $call_to_action['phila_action_panel_fa_multi'] : ''; + + +
    +
    +

    >

    +
    +
    @@ -66,18 +114,19 @@
    -
    - -
    -
    +
    + +
    +
    - $link_url, - 'content_type' => $action_panel_title, - 'nice_name' => $action_panel_title - );?> - + $link_url, + 'content_type' => $action_panel_title, + 'nice_name' => $action_panel_title + );?> + +
    -
    - + + diff --git a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/mayor/home.php b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/mayor/home.php index d1b05f9a7a..002ae11c09 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/mayor/home.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/departments/v2/mayor/home.php @@ -16,7 +16,7 @@ function extract_full_url($array) {
    -
    +
    Mayor Cherelle L. Parker diff --git a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php index 72148cec6b..d9e4f31085 100644 --- a/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php +++ b/wp/wp-content/themes/phila.gov-theme/partials/posts/post-grid.php @@ -149,8 +149,7 @@