PHP 클래스 Timber\TextHelper

파일 보기 프로젝트 열기: jarednova/timber 1 사용 예제들

공개 메소드들

메소드 설명
close_tags ( string $html ) : string
trim_characters ( string $text, integer $num_chars = 60, string | null $more = null ) : string Trims text to a certain number of characters.
trim_words ( string $text, integer $num_words = 55, string | null | false $more = null, string $allowed_tags = 'p a span b i br blockquote' ) : string

메소드 상세

close_tags() 공개 정적인 메소드

public static close_tags ( string $html ) : string
$html string
리턴 string

trim_characters() 공개 정적인 메소드

This function can be useful for excerpt of the post As opposed to wp_trim_words trims characters that makes text to take the same amount of space in each post for example
부터: 1.2.0
저자: @CROSP
public static trim_characters ( string $text, integer $num_chars = 60, string | null $more = null ) : string
$text string Text to trim.
$num_chars integer Number of characters. Default is 60.
$more string | null Optional. What to append if $text needs to be trimmed. Default '…'.
리턴 string trimmed text.

trim_words() 공개 정적인 메소드

public static trim_words ( string $text, integer $num_words = 55, string | null | false $more = null, string $allowed_tags = 'p a span b i br blockquote' ) : string
$text string
$num_words integer
$more string | null | false text to appear in "Read more...". Null to use default, false to hide
$allowed_tags string
리턴 string