Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Last active June 10, 2020 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Auke1810/e0e3933af36e87bde4e90f961fb55c1a to your computer and use it in GitHub Desktop.
Save Auke1810/e0e3933af36e87bde4e90f961fb55c1a to your computer and use it in GitHub Desktop.
Filternaam: wppfm_xml_element_attribute Drie parameters: attribute_value: dit is de standaard waarde die dus gewijzigd kan worden. Is standaard een empty string. xml_key: dit is de naam van het xml element, dus deze parameter kan worden gebruikt om het gewenste xml element te vinden xml_value: de waarde van het xml element. Dus om een attribute …
Function add_attribute_to_xml_tag( $attribute_value, $xml_key, $xml_value ) {
if ( 'bottles' === $xml_key ) {
return 'size=”750 ml”';
} else {
return $attribute_value;
}
}
add_filter( 'wppfm_xml_element_attribute', 'add_attribute_to_xml_tag', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment