-
Notifications
You must be signed in to change notification settings - Fork 4
string
Polmonite edited this page Sep 21, 2019
·
1 revision
These are used to manipulate strings. Available string filters are:
-
lowercase
: transform the string in lowercase; -
uppercase
: transform the string in uppercase; -
capitalize
: capitalize the string; -
customcase:{delimiter}
: transform the string in customcase, which is like asnake_case
with a custom$delimiter
, passed as an argument; -
kebabcase
: transform the string inkebab-case
; -
snakecase
: transform the string insnake_case
; -
pascalcase
: transform the string inPascalCase
; -
camelcase
: transform the string incamelCase
; -
slug
: transform the string in a slug through WordPresssanitize_title
function; -
append:{suffix}
: append the specified$suffix
to the string; -
prepend:{prefix}
: prepend the specified$prefix
to the string; -
padleft:{pad_length},{pad_string}
: pad a string to the left with$pad_string
until it reaches a length of$pad_length
; -
padright:{pad_length},{pad_string}
: pad a string to the right with$pad_string
until it reaches a length of$pad_length
; -
padboth:{pad_length},{pad_string}
: pad a string both to the left and the right with$pad_string
until it reaches a length of$pad_length
; -
hash
: creates an hash of the string; -
escape_html
: calls thehtmlspecialchars
function; -
replace:{what},{?with},{?force_string_replacement}
: executes a string replacement of$what
with$with
on the string; the second argument, if omitted, defaults to empty string; this methods will try and guess if the passed$what
parameter is a regular expression (regexp must be passed using the/
delimiters), but this behaviour can be ignored by passing the third argument$force_string_replacement
equal to1
(it defaults to0
); -
truncate:{max_length},{?pad_with}
: truncates the string, if needed, to a maximum of$max_length
characters; a second optional parameter,$pad_with
, can be passed; this will become the end of the string only in case it needs to be truncated (useful to add ellipsis or similar text).
- Getting started
- Why Malini
- BaseAccessor
- ThisAccessor
- AllMetaAccessor
- MetaAccessor
- GroupedMetaAccessor
- MediaAccessor
- PostsAccessor
- PostAccessor
- Malini\Post
- Malini\Archive
- JSON Helper
- Filter Option Syntax
- Create your own Accessor
- Create your own Decorator
- Available Extensions
- Malini\Aeria
- Malini\YOAST
- Malini\ACF