Created
September 17, 2022 12:23
-
-
Save chrisjangl/563330800b1721ac3be0e7484923f43a to your computer and use it in GitHub Desktop.
[WP Pizza] Change all ingredients to a specific meal size when on the WP Pizza Ingredients page, Ingredients tab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set this to the ID of the meal size | |
var mealSize = ""; | |
// get a node list of all the ingredients on the page | |
var ingredients = document.querySelectorAll('.wppizza_ingr_option.wppizza_option'); | |
// and then loop through each one, setting the meal size | |
ingredients.forEach(function(ingredient){ | |
let dropdown = ingredient.querySelector('select.ingredients'); | |
dropdown.value = mealSize; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment