attribute_escape (line 1787)
Escaping for HTML attributes.
string
attribute_escape
(string $text)
backslashit (line 893)
Adds backslashes before letters and before a number at the start of a string.
string
backslashit
(string $string)
-
string
$string: Value to which backslashes will be added.
clean_pre (line 167)
Accepts matches array from preg_replace_callback in wpautop() or a string.
Ensures that the contents of a <pre>...</pre> HTML block are not converted into paragraphs or line-breaks.
string
clean_pre
(array|string $matches)
-
array|string
$matches: The array or string
clean_url (line 1545)
Checks and cleans a URL.
A number of characters are removed from the URL. If the URL is for displaying (the default behaviour) amperstands are also replaced. The 'esc_url' filter is applied to the returned cleaned URL.
string
clean_url
(string $url, [array $protocols = null], [string $context = 'display'])
-
string
$url: The URL to be cleaned.
-
array
$protocols: Optional. An array of acceptable protocols. Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn' if not set.
-
string
$context: Optional. How the URL will be used. Default is 'display'.
ent2ncr (line 1259)
Converts named entities into numbered entities.
string
ent2ncr
(string $text)
-
string
$text: The text within which entities will be converted.
esc_attr (line 1753)
Escaping for HTML attributes.
string
esc_attr
(string $text)
esc_html (line 1720)
Escaping for HTML blocks.
string
esc_html
(string $text)
esc_js (line 1682)
Escape single quotes, htmlspecialchar " < > &, and fix line endings.
Escapes text strings for echoing in JS, both inline (for example in onclick="...") and inside <script> tag. Note that the strings have to be in single quotes. The filter 'js_escape' is also applied here.
string
esc_js
(string $text)
-
string
$text: The text to be escaped.
esc_sql (line 1619)
Escapes data for use in a MySQL query
This is just a handy shortcut for $bpdb->escape(), for completeness' sake
string
esc_sql
(string $sql)
-
string
$sql: Unescaped SQL data
esc_textarea (line 1769)
Escaping for textarea values.
string
esc_textarea
(string $text)
esc_url (line 1643)
Checks and cleans a URL.
A number of characters are removed from the URL. If the URL is for displaying (the default behaviour) amperstands are also replaced. The 'esc_url' filter is applied to the returned cleaned URL.
string
esc_url
(string $url, [array $protocols = null])
-
string
$url: The URL to be cleaned.
-
array
$protocols: Optional. An array of acceptable protocols. Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet' if not set.
esc_url_raw (line 1661)
Performs esc_url() for database usage.
string
esc_url_raw
(string $url, [array $protocols = null])
-
string
$url: The URL to be cleaned.
-
array
$protocols: An array of acceptable protocols.
force_balance_tags (line 737)
Balances tags of string using a modified stack.
string
force_balance_tags
(string $text)
-
string
$text: Text to be balanced.
format_to_edit (line 851)
Acts on text which is about to be edited.
Unless $richedit is set, it is simply a holder for the 'format_to_edit' filter. If $richedit is set true htmlspecialchars() will be run on the content, converting special characters to HTMl entities.
string
format_to_edit
(string $content, [bool $richedit = false])
-
string
$content: The text about to be edited.
-
bool
$richedit: Whether or not the $content should pass through htmlspecialchars(). Default false.
is_email (line 1093)
Verifies that an email is valid.
Does not grok i18n domains. Not RFC compliant.
string|bool
is_email
(string $email, [boolean $check_dns = false])
-
string
$email: Email address to verify.
-
boolean
$check_dns: Whether to check the DNS for the domain using checkdnsrr().
js_escape (line 1706)
Escape single quotes, specialchar double quotes, and fix line endings.
The filter 'js_escape' is also applied by esc_js()
string
js_escape
(string $text)
-
string
$text: The text to be escaped.
like_escape (line 1803)
Escapes text for SQL LIKE special characters % and _.
string
like_escape
(string $text)
-
string
$text: The text to be escaped.
make_clickable (line 1063)
Convert plaintext URI to HTML links.
Converts URI, www and ftp, and email addresses. Finishes by fixing links within links.
string
make_clickable
(string $ret)
-
string
$ret: Content to convert URIs.
remove_accents (line 474)
Converts all accent characters to ASCII characters.
If there are no accent characters, then the string given is just returned.
string
remove_accents
(string $string)
-
string
$string: Text that might have accent characters
sanitize_email (line 1172)
Strips out all characters that are not allowable in an email.
string
sanitize_email
(string $email)
-
string
$email: Email address to filter.
sanitize_text_field (line 1932)
Sanitize a string from user input or from the db
check for invalid UTF-8, Convert single < characters to entity, strip all tags, remove line breaks, tabs and extra whitre space, strip octets.
string
sanitize_text_field
(string $str)
sanitize_title (line 658)
Sanitizes title or use fallback title.
Specifically, HTML and PHP tags are stripped. Further actions can be added via the plugin API. If $title is empty and $fallback_title is set, the latter will be used.
string
sanitize_title
(string $title, [string $fallback_title = ''])
-
string
$title: The string to be sanitized.
-
string
$fallback_title: Optional. A title to use if $title is empty.
sanitize_title_with_dashes (line 682)
Sanitizes title, replacing whitespace with dashes.
Limits the output to alphanumeric characters, underscore (_) and dash (-). Whitespace becomes a dash.
string
sanitize_title_with_dashes
(string $title)
-
string
$title: The title to be sanitized.
sanitize_user (line 626)
Sanitize username stripping out unsafe characters.
If $strict is true, only alphanumeric characters (as well as _, space, ., -,
string
sanitize_user
(string $username, [bool $strict = false])
-
string
$username: The username to be sanitized.
-
bool
$strict: If set limits $username to specific characters. Default false.
seems_utf8 (line 196)
Checks to see if a string is utf8 encoded.
NOTE: This function checks for 5-Byte sequences, UTF8 has Bytes Sequences with a maximum length of 4.
bool
seems_utf8
(string $str)
-
string
$str: The string to be checked
stripslashes_deep (line 952)
Navigates through an array and removes slashes from the values.
If an array is passed, the array_map() function causes a callback to pass the value back to the function. The slashes from this value will removed.
array|string
stripslashes_deep
(array|string $value)
-
array|string
$value: The array or string to be striped.
trailingslashit (line 916)
Appends a trailing slash.
Will remove trailing slash if it exists already before adding a trailing slash. This prevents double slashing a string or path.
The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.
string
trailingslashit
(string $string)
-
string
$string: What to add the trailing slash to.
untrailingslashit (line 933)
Removes trailing slash if it exists.
The primary use of this is for paths and thus should be used for paths. It is not restricted to paths and offers no specific path support.
string
untrailingslashit
(string $string)
-
string
$string: What to remove the trailing slash from.
urlencode_deep (line 970)
Navigates through an array and encodes the values to be used in a URL.
Uses a callback to pass the value of the array back to the function as a string.
array|string
urlencode_deep
(array|string $value)
-
array|string
$value: The array or string to be encoded.
utf8_uri_encode (line 421)
Encode the Unicode values to be used in the URI.
string
utf8_uri_encode
(string $utf8_string, [int $length = 0])
-
string
$utf8_string
-
int
$length: Max length of the string
wptexturize (line 38)
Replaces common plain text characters into formatted entities
As an example,
'cause today's effort makes it worth tomorrows "holiday"...
Becomes:
’cause today’s effort makes it worth tomorrow’s “holiday”…
Code within certain html blocks are skipped.
string
wptexturize
(string $text)
-
string
$text: The text to be formatted
wp_check_invalid_utf8 (line 371)
Checks for invalid UTF8 in a string.
string
wp_check_invalid_utf8
(string $string, [boolean $strip = false])
-
string
$string: The text which is to be checked.
-
boolean
$strip: Optional. Whether to attempt to strip out invalid UTF8. Default is false.
wp_html_excerpt (line 1881)
Safely extracts not more than the first $count characters from html string.
UTF-8, tags and entities safe prefix extraction. Entities inside will *NOT* be counted as one character. For example & will be counted as 4, < as 3, etc.
string
wp_html_excerpt
(integer $str, integer $count)
-
integer
$str: String to get the excerpt from.
-
integer
$count: Maximum number of characters to take.
wp_parse_str (line 1824)
Parses a string into variables to be stored in an array.
Uses parse_str() and stripslashes if magic_quotes_gpc is on.
void
wp_parse_str
(string $string, &$array, array $array)
-
string
$string: The string to be parsed.
-
array
$array: Variables will be stored in this array.
-
&$array
wp_pre_kses_less_than (line 1844)
Convert lone less than signs.
KSES already converts lone greater than signs.
string
wp_pre_kses_less_than
(string $text)
-
string
$text: Text to be converted.
wp_pre_kses_less_than_callback (line 1858)
Callback function used by preg_replace.
string
wp_pre_kses_less_than_callback
(array $matches)
-
array
$matches: Populated by matches to preg_replace.
wp_specialchars (line 1734)
Escaping for HTML blocks
void
wp_specialchars
( $string, [ $quote_style = ENT_NOQUOTES], [ $charset = false], [ $double_encode = false])
-
$string
-
$quote_style
-
$charset
-
$double_encode
wp_specialchars_decode (line 312)
Converts a number of HTML entities into their special characters.
Specifically deals with: &, <, >, ", and '.
$quote_style can be set to ENT_COMPAT to decode " entities, or ENT_QUOTES to do both " and '. Default is ENT_NOQUOTES where no quotes are decoded.
string
wp_specialchars_decode
(string $string, [mixed $quote_style = ENT_NOQUOTES])
-
string
$string: The text which is to be decoded.
-
mixed
$quote_style: Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old _wp_specialchars() values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
wp_strip_all_tags (line 1906)
Properly strip all HTML tags including script and style
string
wp_strip_all_tags
(string $string, [bool $remove_breaks = false])
-
string
$string: String containing HTML tags
-
bool
$remove_breaks: optional Whether to remove left over line breaks and white space chars
zeroise (line 879)
Add leading zeros when necessary.
If you set the threshold to '4' and the number is '10', then you will get back '0010'. If you set the number to '4' and the number is '5000', then you will get back '5000'.
Uses sprintf to append the amount of zeros based on the $threshold parameter and the size of the number. If the number is large enough, then no zeros will be appended.
string
zeroise
(mixed $number, int $threshold)
-
mixed
$number: Number to append zeros to if not greater than threshold.
-
int
$threshold: Digit places number needs to be to not have zeros added.
_wp_specialchars (line 235)
Converts a number of special characters into their HTML entities.
Specifically deals with: &, <, >, ", and '.
$quote_style can be set to ENT_COMPAT to encode " to ", or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded.
string
_wp_specialchars
(string $string, [mixed $quote_style = ENT_NOQUOTES], [string $charset = false], [boolean $double_encode = false])
-
string
$string: The text which is to be encoded.
-
mixed
$quote_style: Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
-
string
$charset: Optional. The character encoding of the string. Default is false.
-
boolean
$double_encode: Optional. Whether or not to encode existing html entities. Default is false.