[ Index ]

PHP Cross Reference of Wordpress 2.9.1

title

Body

[close]

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

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

File Size: 2849 lines (90 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 83 functions

  wptexturize()
  _wptexturize_pushpop_element()
  clean_pre()
  wpautop()
  shortcode_unautop()
  seems_utf8()
  _wp_specialchars()
  wp_specialchars_decode()
  wp_check_invalid_utf8()
  utf8_uri_encode()
  remove_accents()
  sanitize_file_name()
  sanitize_user()
  sanitize_title()
  sanitize_title_with_dashes()
  sanitize_sql_orderby()
  sanitize_html_class()
  convert_chars()
  funky_javascript_callback()
  funky_javascript_fix()
  balanceTags()
  force_balance_tags()
  format_to_edit()
  format_to_post()
  zeroise()
  backslashit()
  trailingslashit()
  untrailingslashit()
  addslashes_gpc()
  stripslashes_deep()
  urlencode_deep()
  antispambot()
  _make_url_clickable_cb()
  _make_web_ftp_clickable_cb()
  _make_email_clickable_cb()
  make_clickable()
  wp_rel_nofollow()
  wp_rel_nofollow_callback()
  translate_smiley()
  convert_smilies()
  is_email()
  wp_iso_descrambler()
  get_gmt_from_date()
  get_date_from_gmt()
  iso8601_timezone_to_offset()
  iso8601_to_datetime()
  popuplinks()
  sanitize_email()
  human_time_diff()
  wp_trim_excerpt()
  ent2ncr()
  wp_richedit_pre()
  wp_htmledit_pre()
  clean_url()
  _deep_replace()
  esc_sql()
  esc_url()
  esc_url_raw()
  sanitize_url()
  htmlentities2()
  esc_js()
  js_escape()
  esc_html()
  wp_specialchars()
  esc_attr()
  attribute_escape()
  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()

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 $opening Tag closing  character
return: object

clean_pre($matches)   X-Ref
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.

param: array|string $matches The array or string
return: string The pre block without paragraph/line-break conversion.

wpautop($pee, $br = 1)   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: int|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.

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 or not 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. Trim 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
Sanitize username stripping out unsafe characters.

If $strict is true, only alphanumeric characters (as well as _, space, ., -,
@) are returned.
Removes tags, octets, entities, and if strict is enabled, will remove all
non-ASCII characters. After sanitizing, it passes the username, raw username
(the username in the parameter), and the strict parameter as parameters for
the 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_title($title, $fallback_title = '')   X-Ref
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.

param: string $title The string to be sanitized.
param: string $fallback_title Optional. A title to use if $title is empty.
return: string The sanitized string.

sanitize_title_with_dashes($title)   X-Ref
Sanitizes title, replacing whitespace with dashes.

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

param: string $title The title to be 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|false Returns the order by clause if it is a match, false otherwise.

sanitize_html_class($class, $fallback)   X-Ref
Santizes a 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 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.

funky_javascript_callback($matches)   X-Ref
Callback used to change %uXXXX to &#YYY; syntax

param: array $matches Single Match
return: string An HTML entity

funky_javascript_fix($text)   X-Ref
Fixes javascript bugs in browsers.

Converts unicode characters to HTML numbered entities.

param: string $text Text to be made safe.
return: string Fixed text.

balanceTags( $text, $force = false )   X-Ref
Will only balance the tags if forced to and the option is set to balance tags.

The option 'use_balanceTags' is used for whether the tags will be balanced.
Both the $force parameter and 'use_balanceTags' option will have to be true
before the tags will be balanced.

param: string $text Text to be balanced
param: bool $force 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.

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.

param: string $content The text about to be edited.
param: bool $richedit Whether or not the $content should pass through htmlspecialchars(). Default false.
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 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.

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: array|string $value The array or string to be striped.
return: array|string Stripped array (or string in the callback).

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

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

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

param: string $emailaddy Email address.
param: int $mailto Optional. Range from 0 to 1. Used for 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($ret)   X-Ref
Convert plaintext URI to HTML links.

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

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

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 used 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($smiley)   X-Ref
Convert one smiley code to the icon graphic file equivalent.

Looks up one smiley code in the $wpsmiliestrans global array and returns an
<img> string for that smiley.

param: string $smiley 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, $check_dns = 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 $check_dns Whether to check the DNS for the domain using checkdnsrr().
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

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. 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 in the Y-m-d H:i:s format. 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 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 ' [...]' 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 ' [...]' string can be modified by plugins/themes using the excerpt_more filter

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

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.

clean_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) amperstands are also replaced. The 'esc_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 Optional. How the URL will be used. Default is 'display'.
return: string The cleaned $url after the 'cleaned_url' filter is 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
param: string $subject
return: string The processed string

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

This is just a handy shortcut for $wpdb->escape(), for completeness' sake

param: string $sql Unescaped SQL data
return: string The cleaned $sql

esc_url( $url, $protocols = null )   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) amperstands are also replaced. The 'esc_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.
return: string The cleaned $url after the 'cleaned_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.

sanitize_url( $url, $protocols = null )   X-Ref
Performs esc_url() for database or redirect 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, 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.

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

js_escape( $text )   X-Ref
Escape single quotes, specialchar double quotes, and fix line endings.

The filter 'js_escape' is also applied by esc_js()

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

wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false )   X-Ref
Escaping for HTML blocks


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

param: string $text
return: string

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

param: string $text
return: string

tag_escape($tag_name)   X-Ref
Escape a 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 )   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: integer $str String to get the excerpt from.
param: integer $count Maximum number of characters to take.
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, $base)   X-Ref
Callback to add a base url to relative links in passed content.

param: string $m The matched link.
param: string $base The base URL to prefix to links.
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 striped 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, $target )   X-Ref
Callback to add a target attribute to all links in passed content.

param: string $m The matched link.
param: string $target The Target to add to the links.
return: string The processed link.

normalize_whitespace( $str )   X-Ref
No description

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 whitre space,
strip octets.

param: string $str
return: string



Generated: Fri Jan 8 00:19:48 2010 Cross-referenced by PHPXref 0.7