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

Add filters in attribute selection UI (html-product-attribute.php) #11049

Merged
merged 2 commits into from Jun 6, 2016

Conversation

Projects
None yet
2 participants
@TeemuSuoranta
Copy link

TeemuSuoranta commented Jun 5, 2016

Hi!

I made a request for couple of filters in attribute selection UI in WordPress.org (https://wordpress.org/support/topic/filter-request-attribute-select-in-html-product-attributephp) and was guided to make a pull request here.

I added two filters:

  1. Attributes get_terms arguments
  2. Attribute name (+ escaping with esc_attr)

Use cases:

  1. Multilingual filtering (show attributes only in current language), exclude or include terms based on custom logic
  2. Adding information for the name like count, language, parent name

Possible problems:

  1. "Fields" argument shouldn't probably be messed with. We could force it to be what it is by overriding it after filter.
  2. I solved HTML/JS injection with esc_attr so nothing here

Originally, I wanted to pass the product id for the filters but then I realised that there is no way to do this when creating a new product (or any post in general).

@mikejolley mikejolley merged commit 779ab28 into woocommerce:master Jun 6, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment