Is there any good reason to have $the_excerpt = $the_excerpt?

In the plugin Taxonomy Listing there is the following function:

function scprtz_tdl_get_excerpt_by_id($post_id){
$the_post = get_post($post_id); //Gets post ID
$the_excerpt = $the_post->post_content; //Gets post_content to be used as a basis for the excerpt
$excerpt_length = 25; //Sets excerpt length by word count
$the_excerpt = strip_tags(strip_shortcodes($the_excerpt)); //Strips tags and images
$words = explode(‘ ‘, $the_excerpt, $excerpt_length + 1);

if(count($words) > $excerpt_length) :
array_pop($words);
array_push($words, ‘…’);
$the_excerpt = implode(‘ ‘, $words);
endif;

$the_excerpt = $the_excerpt;

return $the_excerpt;
}

Note towards the end, $the_excerpt = $the_excerpt. Is there any reason to have such a line? Seems to me it is setting itself to itself, which accomplishes nothing?

Read more here:: Is there any good reason to have $the_excerpt = $the_excerpt?

Leave a Reply

Your email address will not be published. Required fields are marked *