Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that all terms match the Ad Layer #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

srtfisher
Copy link
Member

@srtfisher srtfisher commented Feb 5, 2018

Ensure that all of the Ad Layer's terms are matched. Previously, it would let any match validate the layer for use. This doesn't work when we want to have more granular control over the Ad Layer (multiple taxonomies requiring multiple terms to be matched).

Copy link

@kjbenk kjbenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏂

if ( ! empty( $taxonomy_terms ) ) {
foreach ( $taxonomy_terms as $taxonomy => $terms ) {
if ( has_term( $terms, $taxonomy ) ) {
$taxonomy_match = true;
} else {
$taxonomy_match = false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a breaking change since themes might be relying on Ad Layers to match for only a single taxonomy. The code is sound, but I just wanted to mention the concern for backwards compatibilty. Maybe an Ad Layers expert can weigh in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants