Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@dbd0756 from refs/tags/v1.0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed Oct 8, 2024
1 parent 8c21aa4 commit 5b3e310
Show file tree
Hide file tree
Showing 14 changed files with 932 additions and 555 deletions.
6 changes: 5 additions & 1 deletion includes/facets/class-facets.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ public static function format_label($label) {
* @return string
*/
public static function construct_cache_key($query = [], $selected = []) {
$invalidate = get_option('prc_facet_cache_invalidate', '10/05/2024');
$invalidate = '10/05/2024b';
// Remove pagination from the query args
$query = array_merge($query, array(
'paged' => 1
));
// Construct an md5 hash of the query and selected facets and a quick invalidation metho.
return md5(wp_json_encode([
'query' => $query,
'selected' => $selected,
Expand All @@ -98,10 +100,12 @@ public static function construct_cache_key($query = [], $selected = []) {
*/
public static function construct_cache_group() {
global $wp;
// Construct an array of URL parameters from the current request to WP.
$url_params = wp_parse_url( '/' . add_query_arg( array( $_GET ), $wp->request . '/' ) );
if ( !is_array($url_params) || !array_key_exists('path', $url_params) ) {
return false;
}
// Remove pagination from the cache group
return preg_replace('/\/page\/[0-9]+/', '', $url_params['path']);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct($query) {
$this->cache_group =\PRC\Platform\Facets::construct_cache_group();
}

public function build_url($filters) {
public function build_url($filters = []) {
return $this->ep_facets->build_query_url($filters);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __construct($loader) {
$loader->add_filter( 'ep_facet_include_taxonomies', $this, 'register_facets' );
$loader->add_filter( 'ep_post_formatted_args', $this, 'restructure_ep_taxonomy_args', 10, 3 );
$loader->add_filter( 'ep_formatted_args', $this, 'add_date_aggregations', 10, 3 );
$loader->add_filter( 'ep_valid_response', $this, 'include_date_aggregation_in_resposne', 19, 4 );
$loader->add_filter( 'ep_valid_response', $this, 'include_date_aggregation_in_response', 19, 4 );
$loader->add_filter( 'ep_facet_taxonomies_size', $this, 'set_facet_taxonomies_size', 10, 2 );
$loader->add_filter( 'ep_set_sort', $this, 'sort_ep_by_date', 20, 2 );
$loader->add_filter( 'prc_platform_rewrite_query_vars', $this, 'register_query_vars' );
Expand Down Expand Up @@ -198,7 +198,7 @@ public function add_date_aggregations( $formatted_args, $args, $wp_query ) {
* @param mixed $query_object Could be WP_Query, WP_User_Query, etc.
* @since 2.5
*/
public function include_date_aggregation_in_resposne( $response, $query, $query_args, $query_object ) {
public function include_date_aggregation_in_response( $response, $query, $query_args, $query_object ) {
if ( empty( $query_object ) || 'WP_Query' !== get_class( $query_object ) || ! $this->ep_facets->is_facetable( $query_object ) ) {
return $response;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/media/art-direction/build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('prc-components', 'prc-hooks', 'react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '2b665047f239101aa57d');
<?php return array('dependencies' => array('prc-components', 'prc-hooks', 'react-jsx-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '4372e48ef27da9b9c89b');
2 changes: 1 addition & 1 deletion includes/media/art-direction/build/index.js

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

2 changes: 1 addition & 1 deletion includes/media/art-direction/build/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion includes/media/art-direction/class-art-direction.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Art_Direction {
// @TODO: look into a programattic way to determine contrast ratio when setting the image and then set this to true if the contrast ratio is too low, also, perhaps rename this to "hasBorder" or something a little more descriptive.
'chartArt' => array(
'type' => 'boolean',
'default' => false,
// 'default' => false,
),
'caption' => array(
'type' => 'string',
Expand Down
Loading

0 comments on commit 5b3e310

Please sign in to comment.