wp_admin_notice()
wp_get_admin_notice()
wp_unique_prefixed_id()
It is similar to wp_unique_id
, but each prefix has its own internal ID counter to make each prefix independent from each other. The ID starts at 1 and increments on each call. The returned value is not universally unique, but it is unique across the life of the PHP process and it’s stable per prefix.
wp_trigger_error()
Generates the message when WP_DEBUG
is true.
_deprecated_class()
There is a ‘deprecated_class_run’ hook that will be called that can be used to get the backtrace up to what file and function called the deprecated class.
The current behavior is to trigger a user error if WP_DEBUG
is true.
This function is to be used in the class constructor for every deprecated class.
See _deprecated_constructor() for deprecating PHP4-style constructors.
wp_enqueue_emoji_styles()
wp_enqueue_admin_bar_bump_styles()
wp_enqueue_admin_bar_header_styles()
wp_enqueue_embed_styles()
get_shortcode_tags_in_content()
Example usage:
get_shortcode_tags_in_content( '
[foo] ' );
// array( 'audio', 'gallery' )
wp_set_option_autoload()
This is a wrapper for wp_set_option_autoload_values() , which can be used to set the autoload value for multiple options at once.
wp_set_options_autoload()
This is a wrapper for wp_set_option_autoload_values() , which can be used to set different autoload values for each option at once.
wp_set_option_autoload_values()
Autoloading too many options can lead to performance problems, especially if the options are not frequently used.
This function allows modifying the autoload value for multiple options without changing the actual option value.
This is for example recommended for plugin activation and deactivation hooks, to ensure any options exclusively used by the plugin which are generally autoloaded can be set to not autoload when the plugin is inactive.
get_options()
Options are loaded as necessary first in order to use a single database query at most.
wp_prime_option_caches_by_group()
wp_prime_option_caches()
Only options that do not already exist in cache will be loaded.
wp_remove_surrounding_empty_script_tags()
This is a helper meant to be used for literal script tag construction within wp_get_inline_script_tag()
or wp_print_inline_script_tag()
.
It removes the literal values of "" and "" from around an inline script after trimming whitespace. Typlically this is used in conjunction with output buffering, where ob_get_clean()
is passed as the $contents
argument.
Example:
// Strips exact literal empty SCRIPT tags.
$js = '<script>sayHello();</script>;
'sayHello();' === wp_remove_surrounding_empty_script_tags( $js );
// Otherwise if anything is different it warns in the JS console.
$js = '<script type="text/javascript">console.log( "hi" );</script>';
'console.error( ... )' === wp_remove_surrounding_empty_script_tags( $js );
_remove_theme_attribute_from_template_part_block()
_inject_theme_attribute_in_template_part_block()
wp_enqueue_block_template_skip_link()
wp_get_https_detection_errors()
This internal function is called by a regular Cron hook to ensure HTTPS support is detected and maintained.
_wp_footnotes_force_filtered_html_on_import_filter()
This filter is the last being executed on force_filtered_html_on_import.
If the input of the filter is true it means we are in an import situation and should enable kses, independently of the user capabilities.
So in that case we call _wp_footnotes_kses_init_filters;
_wp_footnotes_kses_init()
_wp_footnotes_remove_filters()
_wp_footnotes_kses_init_filters()
_wp_filter_post_meta_footnotes()
This function expects slashed data on the footnotes content.
traverse_and_serialize_blocks()
Recursively traverses the blocks and their inner blocks and applies the two callbacks provided as arguments, the first one before serializing a block, and the second one after serializing.
If either callback returns a string value, it will be prepended and appended to the serialized block markup, respectively.
The callbacks will receive a reference to the current block as their first argument, so that they can also modify it, and the current block’s parent block as second argument. Finally, the $pre_callback
receives the previous block, whereas the $post_callback
receives the next block as third argument.
Serialized blocks are returned including comment delimiters, and with all attributes serialized.
This function should be used when there is a need to modify the saved blocks, or to inject markup into the return value. Prefer serialize_blocks
when preparing blocks to be saved to post content.
This function is meant for internal use only.
traverse_and_serialize_block()
Recursively traverses the block and its inner blocks and applies the two callbacks provided as arguments, the first one before serializing the block, and the second one after serializing it.
If either callback returns a string value, it will be prepended and appended to the serialized block markup, respectively.
The callbacks will receive a reference to the current block as their first argument, so that they can also modify it, and the current block’s parent block as second argument. Finally, the $pre_callback
receives the previous block, whereas the $post_callback
receives the next block as third argument.
Serialized blocks are returned including comment delimiters, and with all attributes serialized.
This function should be used when there is a need to modify the saved block, or to inject markup into the return value. Prefer serialize_block
when preparing a block to be saved to post content.
This function is meant for internal use only.
make_after_block_visitor()
The returned function can be used as $post_callback
argument to traverse_and_serialize_block(s)
, where it will append the markup for any blocks hooked after
the given block and as its parent’s last_child
, respectively.
This function is meant for internal use only.