WordPress Function : wp_trim_words()

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • <?php $trimmed_text = wp_trim_words( $text, $num_words = 55, $more = null ); ?>

Parameters

ParameterDetails
$text(String) (Required) Text that will be shortened or trimmed.
$num_words(Integer) (Required) Number of words to which text will be restricted.
$more(String) (Optional) What to append if $text needs to be trimmed.


Got any WordPress Question?