acf_get_truncated()
acf_get_truncated
This function will truncate and return a string
@type function
Хуков нет.
Возвращает
(Строку)
.
Использование
acf_get_truncated( $text, $length );
- $text (обязательный)
- -
- $length **
- -
По умолчанию: 64
Список изменений
С версии 5.0.0 | Введена. |
Код acf_get_truncated() acf get truncated ACF 5.10.2
function acf_get_truncated( $text, $length = 64 ) { // vars $text = trim( $text ); $the_length = strlen( $text ); // cut $return = substr( $text, 0, ( $length - 3 ) ); // ... if ( $the_length > ( $length - 3 ) ) { $return .= '...'; } // return return $return; }