Skip to content

Commit

Permalink
Merge pull request #1886 from 10up/fix/1854
Browse files Browse the repository at this point in the history
Fix/1854
  • Loading branch information
brandwaffle authored Apr 20, 2021
2 parents 4719c8c + bf124c7 commit b41bd2c
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 20 deletions.
47 changes: 35 additions & 12 deletions assets/css/facets.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,40 @@
}

.widget_ep-facet .term a {
align-items: center;
display: flex;
position: relative;
text-decoration: none;

&:after {
content: ' ';
top: 0;
left: 0;
right: 0;
bottom: 0;
display: block;
position: absolute;
z-index: 1;
}
}

.ep-checkbox {
align-items: center;
background-color: #eee;
display: flex;
flex-shrink: 0;
height: 1em;
justify-content: center;
margin-right: 0.25em;
width: 1em;
}

.ep-checkbox::after {
content: "";
border: solid white;
border-width: 0 0.125em 0.125em 0;
display: none;
height: 0.5em;
transform: rotate(45deg);
width: 0.25em;
}

.ep-checkbox.checked {
background-color: #5e5e5e;
}

.ep-checkbox.checked::after {
display: block;
}

.widget_ep-facet .term a:hover .ep-checkbox {
background-color: #ccc;
}
2 changes: 1 addition & 1 deletion dist/css/facets-styles.min.css

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

2 changes: 1 addition & 1 deletion dist/js/facets-script.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion includes/classes/Feature/Autosuggest/Autosuggest.php
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ public function epio_autosuggest_health_check_info( $debug_info ) {
'Post Types' => wp_sprintf( esc_html__( '%l', 'elasticpress' ), $allowed_params['postTypes'] ),
'Post Status' => wp_sprintf( esc_html__( '%l', 'elasticpress' ), $allowed_params['postStatus'] ),
'Search Fields' => wp_sprintf( esc_html__( '%l', 'elasticpress' ), $allowed_params['searchFields'] ),
'Returned Fields' => wp_sprintf( esc_html( var_export( $allowed_params['returnFields'], true ) ) ),
'Returned Fields' => wp_sprintf( esc_html( var_export( $allowed_params['returnFields'], true ) ) ), // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
];

foreach ( $fields as $label => $value ) {
Expand Down
8 changes: 4 additions & 4 deletions includes/classes/Feature/Facets/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function widget( $args, $instance ) {
?>
<div class="term selected level-<?php echo (int) $term->level; ?>" data-term-name="<?php echo esc_attr( strtolower( $term->name ) ); ?>" data-term-slug="<?php echo esc_attr( strtolower( $term_slug ) ); ?>">
<a href="<?php echo esc_attr( $feature->build_query_url( $new_filters ) ); ?>" rel="nofollow">
<input type="checkbox" checked>
<div class="ep-checkbox checked" role="presentation"></div>
<?php echo esc_html( $term->name ); ?>
</a>
</div>
Expand Down Expand Up @@ -250,7 +250,7 @@ public function widget( $args, $instance ) {
?>
<div class="term <?php if ( empty( $term->count ) ) : ?>empty-term<?php endif; ?> <?php if ( $selected ) : ?>selected<?php endif; ?> level-<?php echo (int) $term->level; ?>" data-term-name="<?php echo esc_attr( strtolower( $term->name ) ); ?>" data-term-slug="<?php echo esc_attr( strtolower( $term->slug ) ); ?>">
<a href="<?php echo esc_attr( $feature->build_query_url( $new_filters ) ); ?>" rel="nofollow">
<input type="checkbox" <?php if ( $selected ) : ?>checked<?php endif; ?>>
<div class="ep-checkbox <?php if ( $selected ) : ?>checked<?php endif; ?>" role="presentation"></div>
<?php echo esc_html( $term->name ); ?>
</a>
</div>
Expand Down Expand Up @@ -278,8 +278,8 @@ public function widget( $args, $instance ) {
$new_filters['taxonomies'][ $taxonomy ]['terms'][ $term->slug ] = true;
?>
<div class="term <?php if ( empty( $term->count ) ) : ?>empty-term<?php endif; ?> level-<?php echo (int) $term->level; ?>" data-term-name="<?php echo esc_attr( strtolower( $term->name ) ); ?>" data-term-slug="<?php echo esc_attr( strtolower( $term->slug ) ); ?>">
<a <?php if ( ! empty( $term->count ) ) : ?>href="<?php echo esc_attr( $feature->build_query_url( $new_filters ) ); ?>"<?php endif; ?> rel="nofollow">
<input type="checkbox">
<a <?php if ( ! empty( $term->count ) ) : ?>href="<?php echo esc_attr( $feature->build_query_url( $new_filters ) ); ?>" rel="nofollow"<?php endif; ?>>
<div class="ep-checkbox" role="presentation"></div>
<?php echo esc_html( $term->name ); ?>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion includes/classes/Indexable/Post/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ public function format_args( $args, $wp_query ) {

$args['tax_query'] = array_map(
function( $tax_query ) use ( $args ) {
if ( isset( $tax_query['taxonomy'] ) && 'post_tag' === $tax_query['taxonomy'] && ! in_array( $args['tag_id'], $tax_query['terms'] ) ) {
if ( isset( $tax_query['taxonomy'] ) && 'post_tag' === $tax_query['taxonomy'] && ! in_array( $args['tag_id'], $tax_query['terms'], true ) ) {
$tax_query['terms'][] = $args['tag_id'];
}

Expand Down

0 comments on commit b41bd2c

Please sign in to comment.