A WordPress-centric search engine for devs and theme authors

wp-includes/formatting.php ›

Main WordPress Formatting API.

Function Short description
addslashes_gpcAdds slashes to escape strings.
antispambotConverts email addresses characters to HTML entities to block spam bots.
backslashitAdds backslashes before letters and before a number at the start of a string.
balancetagsBalances tags if forced to, or if the 'use_balanceTags' option is set to true.
capital_p_dangitForever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
convert_charsConverts lone & characters into `&` (a.k.a. `&`)
convert_invalid_entitiesConverts invalid Unicode references range to valid range.
convert_smiliesConvert text equivalent of smilies to images.
ent2ncrConverts named entities into numbered entities.
esc_attrEscaping for HTML attributes.
esc_htmlEscaping for HTML blocks.
esc_jsEscape single quotes, htmlspecialchar " < > &, and fix line endings.
esc_sqlEscapes data for use in a MySQL query.
esc_textareaEscaping for textarea values.
esc_urlChecks and cleans a URL.
esc_url_rawPerforms esc_url() for database usage.
force_balance_tagsBalances tags of string using a modified stack.
format_for_editorFormats text for the editor.
format_to_editActs on text which is about to be edited.
get_date_from_gmtConverts a GMT date into the correct format for the blog.
get_gmt_from_dateReturns a date in the GMT equivalent.
get_html_split_regexRetrieve the regular expression for an HTML element.
get_url_in_contentExtract and return the first URL from passed content.
htmlentities2Convert entities, while preserving already-encoded entities.
human_time_diffDetermines the difference between two timestamps.
iso8601_timezone_to_offsetComputes an offset in seconds from an iso8601 timezone.
iso8601_to_datetimeConverts an iso8601 date to MySQL DateTime format used by post_date[_gmt].
is_emailVerifies that an email is valid.
links_add_base_urlAdd a Base url to relative links in passed content.
links_add_targetAdds a Target attribute to all links in passed content.
make_clickableConvert plaintext URI to HTML links.
map_deepMaps a function to all non-iterable elements of an array or an object.
maybe_hash_hex_colorEnsures that any hex color is properly hashed.
normalize_whitespaceNormalize EOL characters and strip duplicate whitespace.
print_emoji_detection_scriptPrint the inline Emoji detection script if it is not already printed.
print_emoji_stylesPrint the important emoji-related styles.
rawurlencode_deepNavigates through an array, object, or scalar, and raw-encodes the values to be used in a URL.
remove_accentsConverts all accent characters to ASCII characters.
sanitize_emailStrips out all characters that are not allowable in an email.
sanitize_file_nameSanitizes a filename, replacing whitespace with dashes.
sanitize_hex_colorSanitizes a hex color.
sanitize_hex_color_no_hashSanitizes a hex color without a hash. Use sanitize_hex_color() when possible.
sanitize_html_classSanitizes an HTML classname to ensure it only contains valid characters.
sanitize_keySanitizes a string key.
sanitize_mime_typeSanitize a mime type
sanitize_optionSanitises various option values based on the nature of the option.
sanitize_sql_orderbyEnsures a string is a valid SQL 'order by' clause.
sanitize_textarea_fieldSanitizes a multiline string from user input or from the database.
sanitize_text_fieldSanitizes a string from user input or from the database.
sanitize_titleSanitizes a title, or returns a fallback title.
sanitize_title_for_querySanitizes a title with the 'query' context.
sanitize_title_with_dashesSanitizes a title, replacing whitespace and a few other characters with dashes.
sanitize_trackback_urlsSanitize space or carriage return separated URLs that are used to send trackbacks.
sanitize_userSanitizes a username, stripping out unsafe characters.
seems_utf8Checks to see if a string is utf8 encoded.
shortcode_unautopDon't auto-p wrap shortcodes that stand alone
stripslashes_deepNavigates through an array, object, or scalar, and removes slashes from the values.
stripslashes_from_strings_onlyCallback function for `stripslashes_deep()` which strips slashes from strings.
tag_escapeEscape an HTML tag name.
trailingslashitAppends a trailing slash.
translate_smileyConvert one smiley code to the icon graphic file equivalent.
untrailingslashitRemoves trailing forward slashes and backslashes if they exist.
urldecode_deepNavigates through an array, object, or scalar, and decodes URL-encoded values
urlencode_deepNavigates through an array, object, or scalar, and encodes the values to be used in a URL.
url_shortenShorten a URL, to be used as link text.
utf8_uri_encodeEncode the Unicode values to be used in the URI.
wpautopReplaces double line-breaks with paragraph elements.
wptexturizeReplaces common plain text characters into formatted entities
wptexturize_primesImplements a logic tree to determine whether or not "7'." represents seven feet, then converts the special char into either a prime char or a closing quote char.
wp_basenamei18n friendly version of basename()
wp_check_invalid_utf8Checks for invalid UTF8 in a string.
wp_encode_emojiConvert any 4 byte emoji in a string to their equivalent HTML entity.
wp_html_excerptSafely extracts not more than the first $count characters from html string.
wp_html_splitSeparate HTML elements and comments from the text.
wp_iso_descramblerConvert to ASCII from email subjects.
wp_make_link_relativeConvert full URL paths to absolute paths.
wp_parse_strParses a string into variables to be stored in an array.
wp_pre_kses_less_thanConvert lone less than signs.
wp_pre_kses_less_than_callbackCallback function used by preg_replace.
wp_rel_nofollowAdds rel nofollow string to all HTML A elements in content.
wp_rel_nofollow_callbackCallback to add rel=nofollow string to HTML A element.
wp_replace_in_html_tagsReplace characters or phrases within HTML elements only.
wp_slashAdd slashes to a string or array of strings.
wp_spaces_regexpReturns the regexp for common whitespace characters.
wp_specialchars_decodeConverts a number of HTML entities into their special characters.
wp_sprintfWordPress implementation of PHP sprintf() with filters.
wp_sprintf_lLocalize list items before the rest of the content.
wp_staticize_emojiConvert emoji to a static img element.
wp_staticize_emoji_for_emailConvert emoji in emails into static images.
wp_strip_all_tagsProperly strip all HTML tags including script and style
wp_trim_excerptGenerates an excerpt from the content, if needed.
wp_trim_wordsTrims text to a certain number of words.
wp_unslashRemove slashes from a string or array of strings.
zeroiseAdd leading zeros when necessary.
_autop_newline_preservation_helperNewline preservation help function for wpautop
_deep_replacePerform a deep string replace operation to ensure the values in $search are no longer present
_get_wptexturize_shortcode_regexRetrieve the regular expression for shortcodes.
_get_wptexturize_split_regexRetrieve the combined regular expression for HTML and shortcodes.
_links_add_baseCallback to add a base url to relative links in passed content.
_links_add_targetCallback to add a target attribute to all links in passed content.
_make_email_clickable_cbCallback to convert email address match to HTML A element.
_make_url_clickable_cbCallback to convert URI match to HTML A element.
_make_web_ftp_clickable_cbCallback to convert URL match to HTML A element.
_print_emoji_detection_scriptPrints inline Emoji dection script
_sanitize_text_fieldsInternal helper function to sanitize a string from user input or from the db
_split_str_by_whitespaceBreaks a string into chunks by splitting at whitespace characters.
_wptexturize_pushpop_elementSearch for disabled element tags. Push element to stack on tag open and pop on tag close.
_wp_iso_convertHelper function to convert hex encoded chars to ASCII
_wp_specialcharsConverts a number of special characters into their HTML entities.