This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Helper::trim_excerpt()

Trim the excerpt


Return

(string|void)


Source

File: includes/libs/themes/helper.class.php

	private static function trim_excerpt(){
		$video = self::current_video_post();
		if( !$video ){
			return;
		}

		$post = $video->get_post();
		$text = get_the_excerpt( $post );

		if( !$text ){

			$text = get_the_content( '', false, $post );

			$text = strip_shortcodes( $text );
			$text = excerpt_remove_blocks( $text );

			/**
			 * This filter is documented in wp-includes/post-template.php
			 * @ignore
			 */
			$text = apply_filters( 'the_content', $text );
			$text = str_replace( ']]>', ']]>', $text );
		}

		/* translators: Maximum number of words used in a post excerpt. */
		$excerpt_length = (int) _x( '55', 'theme-default-excerpt-length', 'codeflavors-vimeo-video-post-lite' );

		/**
		 * Filters the maximum number of words in a post excerpt.
		 *
		 * @since 2.7.0
		 *
		 * @param int $number The maximum number of words. Default 55.
		 */
		$excerpt_length = (int) apply_filters( 'vimeotheque\themes\theme-default\excerpt-length', $excerpt_length );

		/**
		 * Filters the string in the "more" link displayed after a trimmed excerpt.
		 *
		 * @since 2.9.0
		 *
		 * @param string $more_string   The string shown within the more link.
		 * @param \WP_Post $post        The WP_Post object being processed.
		 */

		$excerpt_more = apply_filters(
			'vimeotheque\themes\theme-default\excerpt-more',
			sprintf(
				' … %s',
				sprintf(
					'<a href="%s" class="vimeotheque-theme default read-more-link">%s</a>',
					esc_url( get_permalink( $post ) ),
					__( 'Continue reading', 'codeflavors-vimeo-video-post-lite' )
				)
			),
			$post
		);

		return wp_trim_words( $text, $excerpt_length, $excerpt_more );
	}

Start your video site now!

Manage and coordinate your Vimeo channels, albums or videos with your WordPress website. Perfect fit for membership, portfolio, online courses or any type of video collection.

Get Vimeotheque PRO!