WordPress at a glance
Главная Functions Formatting

Category: Formatting 27

absint()

Convert a value to non-negative integer. Analog of abs( intval( $foo ) ).

add_magic_quotes()

Escape ', ", \ symbols in the elements of the array. Works with multidimensional arrays too.

antispambot()

Converts email addresses characters to HTML entities to block spam bots.

backslashit()

Adds backslashes before letters and before a number at the start of a string.

balanceTags()

Balances tags if forced to, or if the 'use_balanceTags' option is set to true.

capital_P_dangit()

Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).

convert_smilies()

Convert text equivalent of smilies to images.

ent2ncr()

Converts named entities into numbered entities. ’ becomes ’.

force_balance_tags()

Balances tags of string using a modified stack.

links_add_target()

Adds a Target attribute to all links in passed content.

make_clickable()

Convert plaintext URI to HTML links.

remove_accents()

Converts all accent characters to ASCII characters.

set_url_scheme()

Sets the scheme for a URL.

shortcode_unautop()

Don't auto-p wrap shortcodes that stand alone

size_format()

Convert number of bytes largest unit bytes will fit into.

strip_fragment_from_url()

Strips the #fragment from a URL, if one is present.

trailingslashit()

Appends a trailing slash.

untrailingslashit()

Removes trailing forward slashes and backslashes if they exist.

url_shorten()

Shorten a URL, to be used as link text.

user_trailingslashit()

Retrieves a trailing-slashed string if the site is set for adding trailing slashes.

utf8_uri_encode()

Encode the Unicode values to be used in the URI.

wp_rel_nofollow()

Adds rel nofollow string to all HTML A elements in content.

wp_specialchars_decode()

Converts a number of HTML entities into their special characters.

wp_trim_words()

Trims text to a certain number of words.

wpautop()

Replaces double line-breaks with paragraph elements.

wptexturize()

Replaces common plain text characters into formatted entities

zeroise()

Add leading zeros when necessary.

Sanitizing, Escaping

esc_attr()

Escaping for HTML attributes. Converts <, >, &, ", ' characters to HTML entities. Does not make double escaping.

esc_html()

Escaping for HTML blocks. Converts &lt;, &gt;, &, ", ' characters to HTML entities.

esc_js()

Escape single quotes, htmlspecialchar &quot; &lt; &gt; &amp;, and fix line endings.

esc_textarea()

Escaping for textarea values.

esc_url()

Checks and cleans a URL.

esc_url_raw()

Performs esc_url() for database usage.

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()

Sanitizes an HTML classname to ensure it only contains valid characters.

sanitize_option()

Sanitises various option values based on the nature of the option.

sanitize_post_field()

Sanitize post field based on context.

sanitize_text_field()

Sanitizes a string from user input or from the database.

sanitize_textarea_field()

Sanitizes a multiline string from user input or from the database.

sanitize_title()

Sanitizes a title, or returns a fallback title.

sanitize_title_with_dashes()

Sanitizes a title, replacing whitespace and a few other characters with dashes.

tag_escape()

Escape an HTML tag name.

validate_file()

Validates a file name and path against an allowed set of rules.

wp_filter_kses()

Sanitize content with allowed HTML Kses rules.

wp_filter_nohtml_kses()

Strips all of the HTML tags in the given content. Receives a slashed string (content). Returns the cleared content.

wp_filter_post_kses()

Sanitize content for allowed HTML tags for post content.

wp_kses()

Filters content and keeps only allowable HTML elements.

wp_kses_data()

Sanitize content with allowed HTML Kses rules.

wp_strip_all_tags()

Properly strip all HTML tags including script and style