WooCommerce – variation dropdown with custom attr
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Asked
Viewed
4 times
I’m trying to add custom data attribute to select options for variations in variable product – to use the taxonomy description I have inside the admin panel.
I’d love to get them to custom attr as I they would be accessable thru JS.
<option ... data-variaton-description="Lorem ipsum (...")>
I found that the function responsible for this is wc_dropdown_variation_attribute_options() but I can’t seem to get it working in my functions.php file.
What am I doing wrong?
1
lang-php
Leave an answer