Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Last active March 31, 2018 09:04
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/4b6fdb976436ac17d72615e049b46b8c to your computer and use it in GitHub Desktop.
Save Auke1810/4b6fdb976436ac17d72615e049b46b8c to your computer and use it in GitHub Desktop.
Make title attribute lowercase
/**
* Alter Product feed item
* Make the title attribute lowercase
*/
function alter_feed_item( $attributes, $feed_id, $product_id ) {
// lowercase
$title = $attributes['title'];
$title = strtolower($title); //make lower case
$title = ucfirst($title) // maken first character capitalized
$attributes['title'] = $title;
// IMPORTANT! Always return the $attributes
return $attributes;
}
add_filter( 'wppfm_feed_item_value', 'alter_feed_item', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment