Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Last active November 24, 2021 17:26
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/974ce82c40c16cba42d77211adb781a4 to your computer and use it in GitHub Desktop.
Save Auke1810/974ce82c40c16cba42d77211adb781a4 to your computer and use it in GitHub Desktop.
Uppercase the first character of each word in the title attribute
<?php
function string_uppercase_title( $attributes, $feed_id, $product_id ) {
// this line changes the title data and removes the " <prompt> " string
$attributes['title'] = ucwords(strtolower($attributes['title']));
// IMPORTANT! Always return the $attributes
return $attributes;
}
add_filter( 'wppfm_feed_item_value', 'string_uppercase_title', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment