-
Notifications
You must be signed in to change notification settings - Fork 3
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_casewith 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_titlefunction; -
append:{suffix}: append the specified$suffixto the string; -
prepend:{prefix}: prepend the specified$prefixto the string; -
padleft:{pad_length},{pad_string}: pad a string to the left with$pad_stringuntil it reaches a length of$pad_length; -
padright:{pad_length},{pad_string}: pad a string to the right with$pad_stringuntil it reaches a length of$pad_length; -
padboth:{pad_length},{pad_string}: pad a string both to the left and the right with$pad_stringuntil it reaches a length of$pad_length; -
hash: creates an hash of the string; -
escape_html: calls thehtmlspecialcharsfunction; -
replace:{what},{?with},{?force_string_replacement}: executes a string replacement of$whatwith$withon the string; the second argument, if omitted, defaults to empty string; this methods will try and guess if the passed$whatparameter is a regular expression (regexp must be passed using the/delimiters), but this behaviour can be ignored by passing the third argument$force_string_replacementequal to1(it defaults to0); -
truncate:{max_length},{?pad_with}: truncates the string, if needed, to a maximum of$max_lengthcharacters; 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