WPDev.one
Core PHP Functions

Functions Reference

4125+ PHP functions available in the WordPress global namespace. Complete documentation with parameters, return values, and usage examples.

Showing 1351 to 1400 of 4125 functions (Page 28 of 83)
register_block_style_handle()

Finds a style handle for the block metadata field. It detects when a path

$metadata $field_name $index
get_block_metadata_i18n_schema()

Gets i18n schema for block's metadata read from `block.json` file.

wp_register_block_types_from_metadata_collection()

Registers all block types from a block metadata collection.

$path $manifest
wp_register_block_metadata_collection()

Registers a block metadata collection.

$path $manifest
register_block_type_from_metadata()

Registers a block type from the metadata stored in the `block.json` file.

$file_or_folder $args
register_block_type()

Registers a block type. The recommended way is to register a block type using

$block_type $args
unregister_block_type()

Unregisters a block type.

$name
has_blocks()

Determines whether a post or content string has blocks.

$post
has_block()

Determines whether a $post or a string contains a specific block type.

$block_name $post
get_dynamic_block_names()

Returns an array of the names of all registered dynamic block types.

get_hooked_blocks()

Retrieves block types hooked into the given block, grouped by anchor block type and the relative position.

insert_hooked_blocks()

Returns the markup for blocks hooked to the given anchor block in a specific relative position.

$parsed_anchor_block $relative_position $hooked_blocks +1 more
set_ignored_hooked_blocks_metadata()

Adds a list of hooked block types to an anchor block's ignored hooked block types.

$parsed_anchor_block $relative_position $hooked_blocks +1 more
apply_block_hooks_to_content()

Runs the hooked blocks algorithm on the given content.

$content $context $callback
apply_block_hooks_to_content_from_post_object()

Run the Block Hooks algorithm on a post object's content.

$content $post $callback
remove_serialized_parent_block()

Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks.

$serialized_block
extract_serialized_parent_block()

Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the wrapper block.

$serialized_block
update_ignored_hooked_blocks_postmeta()

Updates the wp_postmeta with the list of ignored hooked blocks

$post
insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata()

Returns the markup for blocks hooked to the given anchor block in a specific relative position and then

$parsed_anchor_block $relative_position $hooked_blocks +1 more
insert_hooked_blocks_into_rest_response()

Hooks into the REST API response for the Posts endpoint and adds the first and last inner blocks.

$response $post
make_before_block_visitor()

Returns a function that injects the theme attribute into, and hooked blocks before, a given block.

$hooked_blocks $context $callback
make_after_block_visitor()

Returns a function that injects the hooked blocks after a given block.

$hooked_blocks $context $callback
serialize_block_attributes()

Given an array of attributes, returns a string in the serialized attributes

$block_attributes
strip_core_block_namespace()

Returns the block name to use for serialization. This will remove the default

$block_name
get_comment_delimited_block_content()

Returns the content of a block, including comment delimiters.

$block_name $block_attributes $block_content
serialize_block()

Returns the content of a block, including comment delimiters, serializing all

$block
serialize_blocks()

Returns a joined string of the aggregate serialization of the given

$blocks
traverse_and_serialize_block()

Traverses a parsed block tree and applies callbacks before and after serializing it.

$block $pre_callback $post_callback
resolve_pattern_blocks()

Replaces patterns in a block tree with their content.

$blocks
traverse_and_serialize_blocks()

Given an array of parsed block trees, applies callbacks before and after serializing them and

$blocks $pre_callback $post_callback
filter_block_content()

Filters and sanitizes block content to remove non-allowable HTML

$text $allowed_html $allowed_protocols
_filter_block_content_callback()

Callback used for regular expression replacement in filter_block_content().

$matches
filter_block_kses()

Filters and sanitizes a parsed block to remove non-allowable HTML

$block $allowed_html $allowed_protocols
filter_block_kses_value()

Filters and sanitizes a parsed block attribute value to remove

$value $allowed_html $allowed_protocols +1 more
filter_block_core_template_part_attributes()

Sanitizes the value of the Template Part block's `tagName` attribute.

$attribute_value $attribute_name $allowed_html
excerpt_remove_blocks()

Parses blocks out of a content string, and renders those appropriate for the excerpt.

$content
excerpt_remove_footnotes()

Parses footnotes markup out of a content string,

$content
_excerpt_render_inner_blocks()

Renders inner blocks from the allowed wrapper blocks

$parsed_block $allowed_blocks
render_block()

Renders a single block into a HTML string.

$parsed_block
parse_blocks()

Parses blocks out of a content string.

$content
do_blocks()

Parses dynamic blocks out of `post_content` and re-renders them.

$content
_restore_wpautop_hook()

If do_blocks() needs to remove wpautop() from the `the_content` filter, this re-adds it afterwards,

$content
block_version()

Returns the current version of the block format that the content string is using.

$content
register_block_style()

Registers a new block style.

$block_name $style_properties
unregister_block_style()

Unregisters a block style.

$block_name $block_style_name
block_has_support()

Checks whether the current block type supports the feature requested.

$block_type $feature $default_value
wp_migrate_old_typography_shape()

Converts typography keys declared under `supports.*` to `supports.typography.*`.

$metadata
build_query_vars_from_query_block()

Helper function that constructs a WP_Query args array from

$block $page
get_query_pagination_arrow()

Helper function that returns the proper pagination arrow HTML for

$block $is_next
build_comment_query_vars_from_block()

Helper function that constructs a comment query vars array from the passed

$block