Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cut off instagram imported titles to certain number of words.
<?php
function dsgnwrks_qa_make_title_excerpted( $import ) {
if ( isset( $import['post_title'] ) ) {
// feel free to edit these 2 values
$number_of_words = 5;
$more = '...';
$import['post_title'] = wp_trim_words( $import['post_title'], $number_of_words, $more );
}
return $import;
}
add_filter( 'dsgnwrks_instagram_pre_save', 'dsgnwrks_qa_make_title_excerpted' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.