Add filter for skipping validation of catalog visibility #2079
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add filter "wc_facebook_validate_product_visibility" to optionally skip the validation of product visibility in catalog and search results.
phpcs
checks? Please removephpcs:ignore
comments in changed files and fix any issues, or delete if not practical.Changes proposed in this Pull Request:
Some plugins like "WooCommerce Single Variations" by IconicWP allow single variations to show up in the catalog. Therefore a common use case is to show a handful of variations in the catalog and hide the parent product from catalog and search results. This prevents the variable product altogether from syncing as the product is validated and part of this validation is whether the product is visible in catalog and search results.
As the hard criteria whether a product is included / synced is the post status and additional exclusion rules by taxonomy, the catalog visibility should be optional.
How to test the changes in this Pull Request:
add_filter('wc_facebook_validate_product_visibility', '__return_false', 10);
to functions.phpChangelog entry