[ Index ]

WordPress Cross Reference

title

Body

[close]

/wp-includes/ -> formatting.php (summary)

Main WordPress Formatting API. Handles many functions for formatting output.

File Size: 3780 lines (125 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 90 functions

  wptexturize()
  _wptexturize_pushpop_element()
  wpautop()
  _autop_newline_preservation_helper()
  shortcode_unautop()
  seems_utf8()
  _wp_specialchars()
  wp_specialchars_decode()
  wp_check_invalid_utf8()
  utf8_uri_encode()
  remove_accents()
  sanitize_file_name()
  sanitize_user()
  sanitize_key()
  sanitize_title()
  sanitize_title_for_query()
  sanitize_title_with_dashes()
  sanitize_sql_orderby()
  sanitize_html_class()
  convert_chars()
  balanceTags()
  force_balance_tags()
  format_to_edit()
  format_to_post()
  zeroise()
  backslashit()
  trailingslashit()
  untrailingslashit()
  addslashes_gpc()
  stripslashes_deep()
  urlencode_deep()
  rawurlencode_deep()
  antispambot()
  _make_url_clickable_cb()
  _make_web_ftp_clickable_cb()
  _make_email_clickable_cb()
  make_clickable()
  _split_str_by_whitespace()
  wp_rel_nofollow()
  wp_rel_nofollow_callback()
  translate_smiley()
  convert_smilies()
  is_email()
  wp_iso_descrambler()
  _wp_iso_convert()
  get_gmt_from_date()
  get_date_from_gmt()
  iso8601_timezone_to_offset()
  iso8601_to_datetime()
  popuplinks()
  sanitize_email()
  human_time_diff()
  wp_trim_excerpt()
  wp_trim_words()
  ent2ncr()
  wp_richedit_pre()
  wp_htmledit_pre()
  _deep_replace()
  esc_sql()
  esc_url()
  esc_url_raw()
  htmlentities2()
  esc_js()
  esc_html()
  esc_attr()
  esc_textarea()
  tag_escape()
  like_escape()
  wp_make_link_relative()
  sanitize_option()
  wp_parse_str()
  wp_pre_kses_less_than()
  wp_pre_kses_less_than_callback()
  wp_sprintf()
  wp_sprintf_l()
  wp_html_excerpt()
  links_add_base_url()
  _links_add_base()
  links_add_target()
  _links_add_target()
  normalize_whitespace()
  wp_strip_all_tags()
  sanitize_text_field()
  wp_basename()
  capital_P_dangit()
  sanitize_mime_type()
  sanitize_trackback_urls()
  wp_slash()
  wp_unslash()
  get_url_in_content()

Functions
Functions that are not part of a class:

wptexturize($text)   X-Ref
Replaces common plain text characters into formatted entities

As an example,
<code>
'cause today's effort makes it worth tomorrow's "holiday"...
</code>
Becomes:
<code>
&#8217;cause today&#8217;s effort makes it worth tomorrow&#8217;s &#8220;holiday&#8221;&#8230;
</code>
Code within certain html blocks are skipped.

param: string $text The text to be formatted
return: string The string replaced with html entities

_wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>')   X-Ref
Search for disabled element tags. Push element to stack on tag open and pop
on tag close. Assumes first character of $text is tag opening.

param: string $text Text to check. First character is assumed to be $opening
param: array $stack Array used as stack of opened tag elements
param: string $disabled_elements Tags to match against formatted as regexp sub-expression
param: string $opening Tag opening character, assumed to be 1 character long
param: string $closing Tag closing character

wpautop($pee, $br = true)   X-Ref
Replaces double line-breaks with paragraph elements.

A group of regex replaces used to identify text formatted with newlines and
replace double line-breaks with HTML paragraph tags. The remaining
line-breaks after conversion become <<br />> tags, unless $br is set to '0'
or 'false'.

param: string $pee The text which has to be formatted.
param: bool $br Optional. If set, this will convert all remaining line-breaks after paragraphing. Default true.
return: string Text which has been converted into correct paragraph tags.

_autop_newline_preservation_helper( $matches )   X-Ref
Newline preservation help function for wpautop

param: array $matches preg_replace_callback matches array
return: string

shortcode_unautop( $pee )   X-Ref
Don't auto-p wrap shortcodes that stand alone

Ensures that shortcodes are not wrapped in <<p>>...<</p>>.

param: string $pee The content.
return: string The filtered content.

seems_utf8($str)   X-Ref
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.

author: bmorel at ssi dot fr (modified)
param: string $str The string to be checked
return: bool True if $str fits a UTF-8 model, false otherwise.

_wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false )   X-Ref
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
&quot;, or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded.

param: string $string The text which is to be encoded.
param: 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.
param: string $charset Optional. The character encoding of the string. Default is false.
param: boolean $double_encode Optional. Whether to encode existing html entities. Default is false.
return: string The encoded text with HTML entities.

wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES )   X-Ref
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.

param: string $string The text which is to be decoded.
param: 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.
return: string The decoded text without HTML entities.

wp_check_invalid_utf8( $string, $strip = false )   X-Ref
Checks for invalid UTF8 in a string.

param: string $string The text which is to be checked.
param: boolean $strip Optional. Whether to attempt to strip out invalid UTF8. Default is false.
return: string The checked text.

utf8_uri_encode( $utf8_string, $length = 0 )   X-Ref
Encode the Unicode values to be used in the URI.

param: string $utf8_string
param: int $length Max length of the string
return: string String with Unicode encoded for URI.

remove_accents($string)   X-Ref
Converts all accent characters to ASCII characters.

If there are no accent characters, then the string given is just returned.

param: string $string Text that might have accent characters
return: string Filtered string with replaced "nice" characters.

sanitize_file_name( $filename )   X-Ref
Sanitizes a filename, replacing whitespace with dashes.

Removes special characters that are illegal in filenames on certain
operating systems and special characters requiring special escaping
to manipulate at the command line. Replaces spaces and consecutive
dashes with a single dash. Trims period, dash and underscore from beginning
and end of filename.

param: string $filename The filename to be sanitized
return: string The sanitized filename

sanitize_user( $username, $strict = false )   X-Ref
Sanitizes a username, stripping out unsafe characters.

Removes tags, octets, entities, and if strict is enabled, will only keep
alphanumeric, _, space, ., -, @. After sanitizing, it passes the username,
raw username (the username in the parameter), and the value of $strict as
parameters for the 'sanitize_user' filter.

param: string $username The username to be sanitized.
param: bool $strict If set limits $username to specific characters. Default false.
return: string The sanitized username, after passing through filters.

sanitize_key( $key )   X-Ref
Sanitizes a string key.

Keys are used as internal identifiers. Lowercase alphanumeric characters, dashes and underscores are allowed.

param: string $key String key
return: string Sanitized key

sanitize_title( $title, $fallback_title = '', $context = 'save' )   X-Ref
Sanitizes a title, or returns a 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.

param: string $title The string to be sanitized.
param: string $fallback_title Optional. A title to use if $title is empty.
param: string $context Optional. The operation for which the string is sanitized
return: string The sanitized string.

sanitize_title_for_query( $title )   X-Ref
Sanitizes a title with the 'query' context.

Used for querying the database for a value from URL.

param: string $title The string to be sanitized.
return: string The sanitized string.

sanitize_title_with_dashes( $title, $raw_title = '', $context = 'display' )   X-Ref
Sanitizes a title, replacing whitespace and a few other characters with dashes.

Limits the output to alphanumeric characters, underscore (_) and dash (-).
Whitespace becomes a dash.

param: string $title The title to be sanitized.
param: string $raw_title Optional. Not used.
param: string $context Optional. The operation for which the string is sanitized.
return: string The sanitized title.

sanitize_sql_orderby( $orderby )   X-Ref
Ensures a string is a valid SQL order by clause.

Accepts one or more columns, with or without ASC/DESC, and also accepts
RAND().

param: string $orderby Order by string to be checked.
return: string|bool Returns the order by clause if it is a match, false otherwise.

sanitize_html_class( $class, $fallback = '' )   X-Ref
Sanitizes an HTML classname to ensure it only contains valid characters.

Strips the string down to A-Z,a-z,0-9,_,-. If this results in an empty
string then it will return the alternative value supplied.

param: string $class The classname to be sanitized
param: string $fallback Optional. The value to return if the sanitization end's up as an empty string.
return: string The sanitized value

convert_chars($content, $deprecated = '')   X-Ref
Converts a number of characters from a string.

Metadata tags <<title>> and <<category>> are removed, <<br>> and <<hr>> are
converted into correct XHTML and Unicode characters are converted to the
valid range.

param: string $content String of characters to be converted.
param: string $deprecated Not used.
return: string Converted string.

balanceTags( $text, $force = false )   X-Ref
Balances tags if forced to, or if the 'use_balanceTags' option is set to true.

param: string $text Text to be balanced
param: bool $force If true, forces balancing, ignoring the value of the option. Default false.
return: string Balanced text

force_balance_tags( $text )   X-Ref
Balances tags of string using a modified stack.

author: Leonard Lin <leonard@acm.org>
param: string $text Text to be balanced.
return: string Balanced text.

format_to_edit( $content, $richedit = false )   X-Ref
Acts on text which is about to be edited.

The $content is run through esc_textarea(), which uses htmlspecialchars()
to convert special characters to HTML entities. If $richedit is set to true,
it is simply a holder for the 'format_to_edit' filter.

param: string $content The text about to be edited.
param: bool $richedit Whether the $content should not pass through htmlspecialchars(). Default false (meaning it will be passed).
return: string The text after the filter (and possibly htmlspecialchars()) has been run.

format_to_post($content)   X-Ref
Holder for the 'format_to_post' filter.

param: string $content The text to pass through the filter.
return: string Text returned from the 'format_to_post' filter.

zeroise($number, $threshold)   X-Ref
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 threshold 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.

param: mixed $number Number to append zeros to if not greater than threshold.
param: int $threshold Digit places number needs to be to not have zeros added.
return: string Adds leading zeros to number if needed.

backslashit($string)   X-Ref
Adds backslashes before letters and before a number at the start of a string.

param: string $string Value to which backslashes will be added.
return: string String with backslashes inserted.

trailingslashit($string)   X-Ref
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.

param: string $string What to add the trailing slash to.
return: string String with trailing slash added.

untrailingslashit($string)   X-Ref
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.

param: string $string What to remove the trailing slash from.
return: string String without the trailing slash.

addslashes_gpc($gpc)   X-Ref
Adds slashes to escape strings.

Slashes will first be removed if magic_quotes_gpc is set, see {@link
http://www.php.net/magic_quotes} for more details.

param: string $gpc The string returned from HTTP request data.
return: string Returns a string escaped with slashes.

stripslashes_deep($value)   X-Ref
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.

param: mixed $value The value to be stripped.
return: mixed Stripped value.

urlencode_deep($value)   X-Ref
Navigates through an array and encodes the values to be used in a URL.

param: array|string $value The array or string to be encoded.
return: array|string $value The encoded array (or string from the callback).

rawurlencode_deep( $value )   X-Ref
Navigates through an array and raw encodes the values to be used in a URL.

param: array|string $value The array or string to be encoded.
return: array|string $value The encoded array (or string from the callback).

antispambot( $email_address, $hex_encoding = 0 )   X-Ref
Converts email addresses characters to HTML entities to block spam bots.

param: string $email_address Email address.
param: int $hex_encoding Optional. Set to 1 to enable hex encoding.
return: string Converted email address.

_make_url_clickable_cb($matches)   X-Ref
Callback to convert URI match to HTML A element.

This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link
make_clickable()}.

param: array $matches Single Regex Match.
return: string HTML A element with URI address.

_make_web_ftp_clickable_cb($matches)   X-Ref
Callback to convert URL match to HTML A element.

This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link
make_clickable()}.

param: array $matches Single Regex Match.
return: string HTML A element with URL address.

_make_email_clickable_cb($matches)   X-Ref
Callback to convert email address match to HTML A element.

This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link
make_clickable()}.

param: array $matches Single Regex Match.
return: string HTML A element with email address.

make_clickable( $text )   X-Ref
Convert plaintext URI to HTML links.

Converts URI, www and ftp, and email addresses. Finishes by fixing links
within links.

param: string $text Content to convert URIs.
return: string Content with converted URIs.

_split_str_by_whitespace( $string, $goal )   X-Ref
Breaks a string into chunks by splitting at whitespace characters.
The length of each returned chunk is as close to the specified length goal as possible,
with the caveat that each chunk includes its trailing delimiter.
Chunks longer than the goal are guaranteed to not have any inner whitespace.

Joining the returned chunks with empty delimiters reconstructs the input string losslessly.

Input string must have no null characters (or eventual transformations on output chunks must not care about null characters)

<code>
_split_str_by_whitespace( "1234 67890 1234 67890a cd 1234   890 123456789 1234567890a    45678   1 3 5 7 90 ", 10 ) ==
array (
0 => '1234 67890 ',  // 11 characters: Perfect split
1 => '1234 ',        //  5 characters: '1234 67890a' was too long
2 => '67890a cd ',   // 10 characters: '67890a cd 1234' was too long
3 => '1234   890 ',  // 11 characters: Perfect split
4 => '123456789 ',   // 10 characters: '123456789 1234567890a' was too long
5 => '1234567890a ', // 12 characters: Too long, but no inner whitespace on which to split
6 => '   45678   ',  // 11 characters: Perfect split
7 => '1 3 5 7 9',    //  9 characters: End of $string
);
</code>

param: string $string The string to split.
param: int $goal The desired chunk length.
return: array Numeric array of chunks.

wp_rel_nofollow( $text )   X-Ref
Adds rel nofollow string to all HTML A elements in content.

param: string $text Content that may contain HTML A elements.
return: string Converted content.

wp_rel_nofollow_callback( $matches )   X-Ref
Callback to add rel=nofollow string to HTML A element.

Will remove already existing rel="nofollow" and rel='nofollow' from the
string to prevent from invalidating (X)HTML.

param: array $matches Single Match
return: string HTML A Element with rel nofollow.

translate_smiley( $matches )   X-Ref
Convert one smiley code to the icon graphic file equivalent.

Callback handler for {@link convert_smilies()}.
Looks up one smiley code in the $wpsmiliestrans global array and returns an
<img> string for that smiley.

param: array $matches Single match. Smiley code to convert to image.
return: string Image string for smiley.

convert_smilies( $text )   X-Ref
Convert text equivalent of smilies to images.

Will only convert smilies if the option 'use_smilies' is true and the global
used in the function isn't empty.

param: string $text Content to convert smilies from text.
return: string Converted content with text smilies replaced with images.

is_email( $email, $deprecated = false )   X-Ref
Verifies that an email is valid.

Does not grok i18n domains. Not RFC compliant.

param: string $email Email address to verify.
param: boolean $deprecated Deprecated.
return: string|bool Either false or the valid email address.

wp_iso_descrambler($string)   X-Ref
Convert to ASCII from email subjects.

param: string $string Subject line
return: string Converted string to ASCII

_wp_iso_convert( $match )   X-Ref
Helper function to convert hex encoded chars to ASCII

param: array $match The preg_replace_callback matches array
return: array Converted chars

get_gmt_from_date( $string, $format = 'Y-m-d H:i:s' )   X-Ref
Returns a date in the GMT equivalent.

Requires and returns a date in the Y-m-d H:i:s format. If there is a
timezone_string available, the date is assumed to be in that timezone,
otherwise it simply subtracts the value of the 'gmt_offset' option. Return
format can be overridden using the $format parameter.

param: string $string The date to be converted.
param: string $format The format string for the returned date (default is Y-m-d H:i:s)
return: string GMT version of the date provided.

get_date_from_gmt( $string, $format = 'Y-m-d H:i:s' )   X-Ref
Converts a GMT date into the correct format for the blog.

Requires and returns a date in the Y-m-d H:i:s format. If there is a
timezone_string available, the returned date is in that timezone, otherwise
it simply adds the value of gmt_offset. Return format can be overridden
using the $format parameter

param: string $string The date to be converted.
param: string $format The format string for the returned date (default is Y-m-d H:i:s)
return: string Formatted date relative to the timezone / GMT offset.

iso8601_timezone_to_offset($timezone)   X-Ref
Computes an offset in seconds from an iso8601 timezone.

param: string $timezone Either 'Z' for 0 offset or '±hhmm'.
return: int|float The offset in seconds.

iso8601_to_datetime($date_string, $timezone = 'user')   X-Ref
Converts an iso8601 date to MySQL DateTime format used by post_date[_gmt].

param: string $date_string Date and time in ISO 8601 format {@link http://en.wikipedia.org/wiki/ISO_8601}.
param: string $timezone Optional. If set to GMT returns the time minus gmt_offset. Default is 'user'.
return: string The date and time in MySQL DateTime format - Y-m-d H:i:s.

popuplinks($text)   X-Ref
Adds a element attributes to open links in new windows.

Comment text in popup windows should be filtered through this. Right now it's
a moderately dumb function, ideally it would detect whether a target or rel
attribute was already there and adjust its actions accordingly.

param: string $text Content to replace links to open in a new window.
return: string Content that has filtered links.

sanitize_email( $email )   X-Ref
Strips out all characters that are not allowable in an email.

param: string $email Email address to filter.
return: string Filtered email address.

human_time_diff( $from, $to = '' )   X-Ref
Determines the difference between two timestamps.

The difference is returned in a human readable format such as "1 hour",
"5 mins", "2 days".

param: int $from Unix timestamp from which the difference begins.
param: int $to Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
return: string Human readable time difference.

wp_trim_excerpt($text = '')   X-Ref
Generates an excerpt from the content, if needed.

The excerpt word amount will be 55 words and if the amount is greater than
that, then the string ' [&hellip;]' will be appended to the excerpt. If the string
is less than 55 words, then the content will be returned as is.

The 55 word limit can be modified by plugins/themes using the excerpt_length filter
The ' [&hellip;]' string can be modified by plugins/themes using the excerpt_more filter

param: string $text Optional. The excerpt. If set to empty, an excerpt is generated.
return: string The excerpt.

wp_trim_words( $text, $num_words = 55, $more = null )   X-Ref
Trims text to a certain number of words.

This function is localized. For languages that count 'words' by the individual
character (such as East Asian languages), the $num_words argument will apply
to the number of individual characters.

param: string $text Text to trim.
param: int $num_words Number of words. Default 55.
param: string $more Optional. What to append if $text needs to be trimmed. Default '&hellip;'.
return: string Trimmed text.

ent2ncr($text)   X-Ref
Converts named entities into numbered entities.

param: string $text The text within which entities will be converted.
return: string Text with converted entities.

wp_richedit_pre($text)   X-Ref
Formats text for the rich text editor.

The filter 'richedit_pre' is applied here. If $text is empty the filter will
be applied to an empty string.

param: string $text The text to be formatted.
return: string The formatted text after filter is applied.

wp_htmledit_pre($output)   X-Ref
Formats text for the HTML editor.

Unless $output is empty it will pass through htmlspecialchars before the
'htmledit_pre' filter is applied.

param: string $output The text to be formatted.
return: string Formatted text after filter applied.

_deep_replace( $search, $subject )   X-Ref
Perform a deep string replace operation to ensure the values in $search are no longer present

Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values
e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that
str_replace would return

param: string|array $search The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.
param: string $subject The string being searched and replaced on, otherwise known as the haystack.
return: string The string with the replaced svalues.

esc_sql( $data )   X-Ref
Escapes data for use in a MySQL query.

Usually you should prepare queries using wpdb::prepare().
Sometimes, spot-escaping is required or useful. One example
is preparing an array for use in an IN clause.

param: string|array $data Unescaped data
return: string|array Escaped data

esc_url( $url, $protocols = null, $_context = 'display' )   X-Ref
Checks and cleans a URL.

A number of characters are removed from the URL. If the URL is for displaying
(the default behaviour) ampersands are also replaced. The 'clean_url' filter
is applied to the returned cleaned URL.

param: string $url The URL to be cleaned.
param: array $protocols Optional. An array of acceptable protocols.
param: string $_context Private. Use esc_url_raw() for database usage.
return: string The cleaned $url after the 'clean_url' filter is applied.

esc_url_raw( $url, $protocols = null )   X-Ref
Performs esc_url() for database usage.

param: string $url The URL to be cleaned.
param: array $protocols An array of acceptable protocols.
return: string The cleaned URL.

htmlentities2($myHTML)   X-Ref
Convert entities, while preserving already-encoded entities.

param: string $myHTML The text to be converted.
return: string Converted text.

esc_js( $text )   X-Ref
Escape single quotes, htmlspecialchar " < > &, and fix line endings.

Escapes text strings for echoing in JS. It is intended to be used for inline JS
(in a tag attribute, for example onclick="..."). Note that the strings have to
be in single quotes. The filter 'js_escape' is also applied here.

param: string $text The text to be escaped.
return: string Escaped text.

esc_html( $text )   X-Ref
Escaping for HTML blocks.

param: string $text
return: string

esc_attr( $text )   X-Ref
Escaping for HTML attributes.

param: string $text
return: string

esc_textarea( $text )   X-Ref
Escaping for textarea values.

param: string $text
return: string

tag_escape($tag_name)   X-Ref
Escape an HTML tag name.

param: string $tag_name
return: string

like_escape($text)   X-Ref
Escapes text for SQL LIKE special characters % and _.

param: string $text The text to be escaped.
return: string text, safe for inclusion in LIKE query.

wp_make_link_relative( $link )   X-Ref
Convert full URL paths to absolute paths.

Removes the http or https protocols and the domain. Keeps the path '/' at the
beginning, so it isn't a true relative link, but from the web root base.

param: string $link Full URL path.
return: string Absolute path.

sanitize_option($option, $value)   X-Ref
Sanitises various option values based on the nature of the option.

This is basically a switch statement which will pass $value through a number
of functions depending on the $option.

param: string $option The name of the option.
param: string $value The unsanitised value.
return: string Sanitized value.

wp_parse_str( $string, &$array )   X-Ref
Parses a string into variables to be stored in an array.

Uses {@link http://www.php.net/parse_str parse_str()} and stripslashes if
{@link http://www.php.net/magic_quotes magic_quotes_gpc} is on.

param: string $string The string to be parsed.
param: array $array Variables will be stored in this array.

wp_pre_kses_less_than( $text )   X-Ref
Convert lone less than signs.

KSES already converts lone greater than signs.

param: string $text Text to be converted.
return: string Converted text.

wp_pre_kses_less_than_callback( $matches )   X-Ref
Callback function used by preg_replace.

param: array $matches Populated by matches to preg_replace.
return: string The text returned after esc_html if needed.

wp_sprintf( $pattern )   X-Ref
WordPress implementation of PHP sprintf() with filters.

param: string $pattern The string which formatted args are inserted.
param: mixed $args,... Arguments to be formatted into the $pattern string.
return: string The formatted string.

wp_sprintf_l($pattern, $args)   X-Ref
Localize list items before the rest of the content.

The '%l' must be at the first characters can then contain the rest of the
content. The list items will have ', ', ', and', and ' and ' added depending
on the amount of list items in the $args parameter.

param: string $pattern Content containing '%l' at the beginning.
param: array $args List items to prepend to the content and replace '%l'.
return: string Localized list items and rest of the content.

wp_html_excerpt( $str, $count, $more = null )   X-Ref
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 &amp; will be counted as 4, &lt; as
3, etc.

param: string $str String to get the excerpt from.
param: integer $count Maximum number of characters to take.
param: string $more Optional. What to append if $str needs to be trimmed. Defaults to empty string.
return: string The excerpt.

links_add_base_url( $content, $base, $attrs = array('src', 'href')   X-Ref
Add a Base url to relative links in passed content.

By default it supports the 'src' and 'href' attributes. However this can be
changed via the 3rd param.

param: string $content String to search for links in.
param: string $base The base URL to prefix to links.
param: array $attrs The attributes which should be processed.
return: string The processed content.

_links_add_base($m)   X-Ref
Callback to add a base url to relative links in passed content.

param: string $m The matched link.
return: string The processed link.

links_add_target( $content, $target = '_blank', $tags = array('a')   X-Ref
Adds a Target attribute to all links in passed content.

This function by default only applies to <a> tags, however this can be
modified by the 3rd param.

<b>NOTE:</b> Any current target attributed will be stripped and replaced.

param: string $content String to search for links in.
param: string $target The Target to add to the links.
param: array $tags An array of tags to apply to.
return: string The processed content.

_links_add_target( $m )   X-Ref
Callback to add a target attribute to all links in passed content.

param: string $m The matched link.
return: string The processed link.

normalize_whitespace( $str )   X-Ref
Normalize EOL characters and strip duplicate whitespace.

param: string $str The string to normalize.
return: string The normalized string.

wp_strip_all_tags($string, $remove_breaks = false)   X-Ref
Properly strip all HTML tags including script and style

param: string $string String containing HTML tags
param: bool $remove_breaks optional Whether to remove left over line breaks and white space chars
return: string The processed string.

sanitize_text_field($str)   X-Ref
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 white space,
strip octets.

param: string $str
return: string

wp_basename( $path, $suffix = '' )   X-Ref
i18n friendly version of basename()

param: string $path A path.
param: string $suffix If the filename ends in suffix this will also be cut off.
return: string

capital_P_dangit( $text )   X-Ref
Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).

Violating our coding standards for a good function name.


sanitize_mime_type( $mime_type )   X-Ref
Sanitize a mime type

param: string $mime_type Mime type
return: string Sanitized mime type

sanitize_trackback_urls( $to_ping )   X-Ref
Sanitize space or carriage return separated URLs that are used to send trackbacks.

param: string $to_ping Space or carriage return separated URLs
return: string URLs starting with the http or https protocol, separated by a carriage return.

wp_slash( $value )   X-Ref
Add slashes to a string or array of strings.

This should be used when preparing data for core API that expects slashed data.
This should not be used to escape data going directly into an SQL query.

param: string|array $value String or array of strings to slash.
return: string|array Slashed $value

wp_unslash( $value )   X-Ref
Remove slashes from a string or array of strings.

This should be used to remove slashes from data passed to core API that
expects data to be unslashed.

param: string|array $value String or array of strings to unslash.
return: string|array Unslashed $value

get_url_in_content( $content )   X-Ref
Extract and return the first URL from passed content.

param: string $content A string which might contain a URL.
return: string The found URL.



Generated: Tue Mar 25 01:41:18 2014 WordPress honlapkészítés: online1.hu