Handles many functions for formatting output.
| Package | WordPress |
| Package | WordPress |
| addslashes_gpc() | Adds slashes to escape strings. |
| antispambot() | Converts email addresses characters to HTML entities to block spam bots |
| attribute_escape() | Escaping for HTML attributes |
| backslashit() | Adds backslashes before letters and before a number at the start of a string |
| balanceTags() | Will only balance the tags if forced to and the option is set to balance tags. |
| clean_pre() | Accepts matches array from preg_replace_callback in wpautop() or a string. |
| clean_url() | Checks and cleans a URL. |
| convert_chars() | Converts a number of characters from a string. |
| convert_smilies() | Convert text equivalent of smilies to images. |
| ent2ncr() | Converts named entities into numbered entities |
| esc_attr() | Escaping for HTML attributes |
| esc_html() | Escaping for HTML blocks |
| esc_js() | Escape single quotes, specialchar double quotes, and fix line endings. |
| esc_sql() | Escapes data for use in a MySQL query |
| esc_url() | Checks and cleans a URL. |
| esc_url_raw() | Performs esc_url() for database usage |
| force_balance_tags() | Balances tags of string using a modified stack |
| format_to_edit() | Acts on text which is about to be edited. |
| format_to_post() | Holder for the 'format_to_post' filter |
| funky_javascript_callback() | Callback used to change %uXXXX to YYY; syntax |
| funky_javascript_fix() | Fixes javascript bugs in browsers. |
| get_date_from_gmt() | Converts a GMT date into the correct format for the blog. |
| get_gmt_from_date() | Returns a date in the GMT equivalent. |
| htmlentities2() | Convert entities, while preserving already-encoded entities |
| human_time_diff() | Determines the difference between two timestamps. |
| iso8601_timezone_to_offset() | Computes an offset in seconds from an iso8601 timezone |
| iso8601_to_datetime() | Converts an iso8601 date to MySQL DateTime format used by post_date[_gmt] |
| is_email() | Verifies that an email is valid. |
| js_escape() | Escape single quotes, specialchar double quotes, and fix line endings. |
| like_escape() | Escapes text for SQL LIKE special characters % and _ |
| links_add_base_url() | Add a Base url to relative links in passed content. |
| links_add_target() | Adds a Target attribute to all links in passed content. |
| make_clickable() | Convert plaintext URI to HTML links. |
| normalize_whitespace() | |
| popuplinks() | Adds a element attributes to open links in new windows. |
| remove_accents() | Converts all accent characters to ASCII characters. |
| sanitize_email() | Strips out all characters that are not allowable in an email |
| sanitize_file_name() | Sanitizes a filename replacing whitespace with dashes |
| sanitize_html_class() | Santizes a html classname to ensure it only contains valid characters |
| sanitize_option() | Sanitises various option values based on the nature of the option. |
| sanitize_sql_orderby() | Ensures a string is a valid SQL order by clause. |
| sanitize_title() | Sanitizes title or use fallback title. |
| sanitize_title_with_dashes() | Sanitizes title, replacing whitespace with dashes. |
| sanitize_url() | Performs esc_url() for database or redirect usage |
| sanitize_user() | Sanitize username stripping out unsafe characters. |
| seems_utf8() | Checks to see if a string is utf8 encoded. |
| stripslashes_deep() | Navigates through an array and removes slashes from the values. |
| tag_escape() | Escape a HTML tag name |
| trailingslashit() | Appends a trailing slash. |
| translate_smiley() | Convert one smiley code to the icon graphic file equivalent. |
| untrailingslashit() | Removes trailing slash if it exists. |
| urlencode_deep() | Navigates through an array and encodes the values to be used in a URL. |
| utf8_uri_encode() | Encode the Unicode values to be used in the URI |
| wpautop() | Replaces double line-breaks with paragraph elements. |
| wptexturize() | Replaces common plain text characters into formatted entities |
| wptexturize_pushpop_element() | |
| wp_check_invalid_utf8() | Checks for invalid UTF8 in a string |
| wp_htmledit_pre() | Formats text for the HTML editor. |
| wp_html_excerpt() | Safely extracts not more than the first $count characters from html string. |
| wp_iso_descrambler() | Convert to ASCII from email subjects |
| wp_make_link_relative() | Convert full URL paths to absolute paths. |
| wp_parse_str() | Parses a string into variables to be stored in an array. |
| wp_pre_kses_less_than() | Convert lone less than signs. |
| wp_pre_kses_less_than_callback() | Callback function used by preg_replace |
| wp_rel_nofollow() | Adds rel nofollow string to all HTML A elements in content |
| wp_rel_nofollow_callback() | Callback to used to add rel=nofollow string to HTML A element. |
| wp_richedit_pre() | Formats text for the rich text editor. |
| wp_specialchars() | Escaping for HTML blocks |
| wp_specialchars_decode() | Converts a number of HTML entities into their special characters. |
| wp_sprintf() | WordPress implementation of PHP sprintf() with filters |
| wp_sprintf_l() | Localize list items before the rest of the content. |
| wp_trim_excerpt() | Generates an excerpt from the content, if needed. |
| zeroise() | Add leading zeros when necessary. |
| _deep_replace() | Perform a deep string replace operation to ensure the values in $search are no longer present |
| _links_add_base() | Callback to add a base url to relative links in passed content |
| _links_add_target() | Callback to add a target attribute to all links in passed content |
| _make_email_clickable_cb() | Callback to convert email address match to HTML A element. |
| _make_url_clickable_cb() | Callback to convert URI match to HTML A element. |
| _make_web_ftp_clickable_cb() | Callback to convert URL match to HTML A element. |
| _wp_specialchars() | Converts a number of special characters into their HTML entities. |
function addslashes_gpc( |
$gpc)
|
string $gpc |
The string returned from HTTP request data. |
function antispambot( |
$emailaddy)
|
string $emailaddy |
Email address. |
int $mailto |
Optional. Range from 0 to 1. Used for encoding. |
function attribute_escape( |
$text)
|
string $text |
function backslashit( |
$string)
|
string $string |
Value to which backslashes will be added. |
function balanceTags( |
$text)
|
string $text |
Text to be balanced |
bool $force |
Forces balancing, ignoring the value of the option. Default false. |
function clean_pre( |
$matches)
|
>...<> HTML block are not
array|string $matches |
The array or string |
function clean_url( |
$url)
|
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. |
string $context |
Optional. How the URL will be used. Default is 'display'. |
function convert_chars( |
$content)
|
string $content |
String of characters to be converted. |
string $deprecated |
Not used. |
function convert_smilies( |
$text)
|
string $text |
Content to convert smilies from text. |
function ent2ncr( |
$text)
|
string $text |
The text within which entities will be converted. |
function esc_attr( |
$text)
|
string $text |
function esc_html( |
$text)
|
string $text |
function esc_js( |
$text)
|
string $text |
The text to be escaped. |
function esc_sql( |
$sql)
|
wpdb->escape(), for completeness' sakestring $sql |
Unescaped SQL data |
function esc_url( |
$url)
|
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. |
function esc_url_raw( |
$url)
|
string $url |
The URL to be cleaned. |
array $protocols |
An array of acceptable protocols. |
function force_balance_tags( |
$text)
|
string $text |
Text to be balanced. |
function format_to_edit( |
$content)
|
string $content |
The text about to be edited. |
bool $richedit |
Whether or not the $content should pass through htmlspecialchars(). Default false. |
function format_to_post( |
$content)
|
string $content |
The text to pass through the filter. |
function funky_javascript_callback( |
$matches)
|
array $matches |
Single Match |
function funky_javascript_fix( |
$text)
|
string $text |
Text to be made safe. |
function get_date_from_gmt( |
$string)
|
string $string |
The date to be converted. |
function get_gmt_from_date( |
$string)
|
string $string |
The date to be converted. |
function htmlentities2( |
$myHTML)
|
string $myHTML |
The text to be converted. |
function human_time_diff( |
$from)
|
int $from |
Unix timestamp from which the difference begins. |
int $to |
Optional. Unix timestamp to end the time difference. Default becomes time() if not set. |
function iso8601_timezone_to_offset( |
$timezone)
|
string $timezone |
Either 'Z' for 0 offset or '±hhmm'. |
function iso8601_to_datetime( |
$date_string)
|
string $date_string |
Date and time in ISO 8601 format http://en.wikipedia.org/wiki/ISO_8601. |
string $timezone |
Optional. If set to GMT returns the time minus gmt_offset. Default is 'user'. |
function is_email( |
$email)
|
string $email |
Email address to verify. |
boolean $check_dns |
Whether to check the DNS for the domain using checkdnsrr(). |
function js_escape( |
$text)
|
string $text |
The text to be escaped. |
function like_escape( |
$text)
|
string $text |
The text to be escaped. |
function links_add_base_url( |
$content)
|
string $content |
String to search for links in. |
string $base |
The base URL to prefix to links. |
array $attrs |
The attributes which should be processed. |
|
function links_add_target( |
$content)
|
string $content |
String to search for links in. |
string $target |
The Target to add to the links. |
array $tags |
An array of tags to apply to. |
function make_clickable( |
$ret)
|
ftp, and email addresses. Finishes by fixing linksstring $ret |
Content to convert URIs. |
function normalize_whitespace( |
$str)
|
$str |
function popuplinks( |
$text)
|
string $text |
Content to replace links to open in a new window. |
function remove_accents( |
$string)
|
string $string |
Text that might have accent characters |
function sanitize_email( |
$email)
|
string $email |
Email address to filter. |
function sanitize_file_name( |
$filename)
|
string $filename |
The filename to be sanitized |
function sanitize_html_class( |
$class)
|
string $class |
The classname to be sanitized |
string $fallback |
The value to return if the sanitization end's up as an empty string. |
function sanitize_option( |
$option)
|
string $option |
The name of the option. |
string $value |
The unsanitised value. |
function sanitize_sql_orderby( |
$orderby)
|
string $orderby |
Order by string to be checked. |
function sanitize_title( |
$title)
|
string $title |
The string to be sanitized. |
string $fallback_title |
Optional. A title to use if $title is empty. |
function sanitize_title_with_dashes( |
$title)
|
string $title |
The title to be sanitized. |
function sanitize_url( |
$url)
|
string $url |
The URL to be cleaned. |
array $protocols |
An array of acceptable protocols. |
function sanitize_user( |
$username)
|
string $username |
The username to be sanitized. |
bool $strict |
If set limits $username to specific characters. Default false. |
function seems_utf8( |
$str)
|
string $str |
The string to be checked |
function stripslashes_deep( |
$value)
|
array|string $value |
The array or string to be striped. |
function tag_escape( |
$tag_name)
|
string $tag_name |
function trailingslashit( |
$string)
|
string $string |
What to add the trailing slash to. |
function translate_smiley( |
$smiley)
|
string $smiley |
Smiley code to convert to image. |
function untrailingslashit( |
$string)
|
string $string |
What to remove the trailing slash from. |
function urlencode_deep( |
$value)
|
array|string $value |
The array or string to be encoded. |
function utf8_uri_encode( |
$utf8_string)
|
string $utf8_string |
|
int $length |
Max length of the string |
function wpautop( |
$pee)
|
string $pee |
The text which has to be formatted. |
int|bool $br |
Optional. If set, this will convert all remaining line-breaks after paragraphing. Default true. |
function wptexturize( |
$text)
|
'cause today's effort makes it worth tomorrow's "holiday"...
’cause today’s effort makes it worth tomorrow’s “holiday”…
string $text |
The text to be formatted |
function wptexturize_pushpop_element( |
$text)
|
$text |
|
$stack |
|
$disabled_elements |
|
$opening |
|
$closing |
function wp_check_invalid_utf8( |
$string)
|
string $string |
The text which is to be checked. |
boolean $strip |
Optional. Whether to attempt to strip out invalid UTF8. Default is false. |
function wp_htmledit_pre( |
$output)
|
string $output |
The text to be formatted. |
function wp_html_excerpt( |
$str)
|
integer $str |
String to get the excerpt from. |
integer $count |
Maximum number of characters to take. |
function wp_iso_descrambler( |
$string)
|
string $string |
Subject line |
function wp_make_link_relative( |
$link)
|
string $link |
Full URL path. |
function wp_parse_str( |
$string)
|
string $string |
The string to be parsed. |
array $array |
Variables will be stored in this array. |
function wp_pre_kses_less_than( |
$text)
|
string $text |
Text to be converted. |
function wp_pre_kses_less_than_callback( |
$matches)
|
array $matches |
Populated by matches to preg_replace. |
function wp_rel_nofollow( |
$text)
|
string $text |
Content that may contain HTML A elements. |
function wp_rel_nofollow_callback( |
$matches)
|
array $matches |
Single Match |
function wp_richedit_pre( |
$text)
|
string $text |
The text to be formatted. |
function wp_specialchars( |
$string)
|
$string |
|
$quote_style |
|
$charset |
|
$double_encode |
function wp_specialchars_decode( |
$string)
|
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. |
function wp_sprintf( |
$pattern)
|
string $pattern |
The string which formatted args are inserted. |
function wp_sprintf_l( |
$pattern)
|
string $pattern |
Content containing '%l' at the beginning. |
array $args |
List items to prepend to the content and replace '%l'. |
function wp_trim_excerpt( |
$text)
|
string $text |
The exerpt. If set to empty an excerpt is generated. |
function zeroise( |
$number)
|
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. |
function _deep_replace( |
$search)
|
string|array $search |
|
string $subject |
function _links_add_base( |
$m)
|
string $m |
The matched link. |
string $base |
The base URL to prefix to links. |
function _links_add_target( |
$m)
|
string $m |
The matched link. |
string $target |
The Target to add to the links. |
function _make_email_clickable_cb( |
$matches)
|
array $matches |
Single Regex Match. |
function _make_url_clickable_cb( |
$matches)
|
array $matches |
Single Regex Match. |
function _make_web_ftp_clickable_cb( |
$matches)
|
array $matches |
Single Regex Match. |
function _wp_specialchars( |
$string)
|
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. |