wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp-includes/blocks.php › WordPress File
Funktionen58
› Functions related to registering and parsing blocks.
Funktion | Kurzbeschreibung |
---|---|
apply_block_hooks_to_content | Runs the hooked blocks algorithm on the given content. |
block_has_support | Checks whether the current block type supports the feature requested. |
block_version | Returns the current version of the block format that the content string is using. |
build_comment_query_vars_from_block | Helper function that constructs a comment query vars array from the passed block properties. |
build_query_vars_from_query_block | Helper function that constructs a WP_Query args array from a `Query` block properties. |
do_blocks | Parses dynamic blocks out of `post_content` and re-renders them. |
excerpt_remove_blocks | Parses blocks out of a content string, and renders those appropriate for the excerpt. |
excerpt_remove_footnotes | Parses footnotes markup out of a content string, and renders those appropriate for the excerpt. |
extract_serialized_parent_block | Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the wrapper block. |
filter_block_content | Filters and sanitizes block content to remove non-allowable HTML from parsed block attribute values. |
filter_block_core_template_part_attributes | Sanitizes the value of the Template Part block's `tagName` attribute. |
filter_block_kses | Filters and sanitizes a parsed block to remove non-allowable HTML from block attribute values. |
filter_block_kses_value | Filters and sanitizes a parsed block attribute value to remove non-allowable HTML. |
generate_block_asset_handle | Generates the name for an asset based on the name of the block and the field name provided. |
get_block_asset_url | Gets the URL to a block asset. |
get_block_metadata_i18n_schema | Gets i18n schema for block's metadata read from `block.json` file. |
get_comments_pagination_arrow | Helper function that returns the proper pagination arrow HTML for `CommentsPaginationNext` and `CommentsPaginationPrevious` blocks based on the provided `paginationArrow` from `CommentsPagination` context. |
get_comment_delimited_block_content | Returns the content of a block, including comment delimiters. |
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. |
get_query_pagination_arrow | Helper function that returns the proper pagination arrow HTML for `QueryPaginationNext` and `QueryPaginationPrevious` blocks based on the provided `paginationArrow` from `QueryPagination` context. |
has_block | Determines whether a $post or a string contains a specific block type. |
has_blocks | Determines whether a post or content string has blocks. |
insert_hooked_blocks | Returns the markup for blocks hooked to the given anchor block in a specific relative position. |
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 adds a list of hooked block types to an anchor block's ignored hooked block types. |
insert_hooked_blocks_into_rest_response | Hooks into the REST API response for the core/navigation block and adds the first and last inner blocks. |
make_after_block_visitor | Returns a function that injects the hooked blocks after a given block. |
make_before_block_visitor | Returns a function that injects the theme attribute into, and hooked blocks before, a given block. |
parse_blocks | Parses blocks out of a content string. |
register_block_script_handle | Finds a script handle for the selected block metadata field. It detects when a path to file was provided and optionally finds a corresponding asset file with details necessary to register the script under automatically generated handle name. It returns unprocessed script handle otherwise. |
register_block_script_module_id | Finds a script module ID for the selected block metadata field. It detects when a path to file was provided and optionally finds a corresponding asset file with details necessary to register the script module under with an automatically generated module ID. It returns unprocessed script module ID otherwise. |
register_block_style | Registers a new block style. |
register_block_style_handle | Finds a style handle for the block metadata field. It detects when a path to file was provided and registers the style under automatically generated handle name. It returns unprocessed style handle otherwise. |
register_block_type | Registers a block type. The recommended way is to register a block type using the metadata stored in the `block.json` file. |
register_block_type_from_metadata | Registers a block type from the metadata stored in the `block.json` file. |
remove_block_asset_path_prefix | Removes the block asset's path prefix if provided. |
remove_serialized_parent_block | Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks. |
render_block | Renders a single block into a HTML string. |
resolve_pattern_blocks | Replaces patterns in a block tree with their content. |
serialize_block | Returns the content of a block, including comment delimiters, serializing all attributes from the given parsed block. |
serialize_blocks | Returns a joined string of the aggregate serialization of the given parsed blocks. |
serialize_block_attributes | Given an array of attributes, returns a string in the serialized attributes format prepared for post content. |
set_ignored_hooked_blocks_metadata | Adds a list of hooked block types to an anchor block's ignored hooked block types. |
strip_core_block_namespace | Returns the block name to use for serialization. This will remove the default "core/" namespace from a block name. |
traverse_and_serialize_block | Traverses a parsed block tree and applies callbacks before and after serializing it. |
traverse_and_serialize_blocks | Given an array of parsed block trees, applies callbacks before and after serializing them and returns their concatenated output. |
unregister_block_style | Unregisters a block style. |
unregister_block_type | Unregisters a block type. |
update_ignored_hooked_blocks_postmeta | Updates the wp_postmeta with the list of ignored hooked blocks where the inner blocks are stored as post content. |
wp_migrate_old_typography_shape | Converts typography keys declared under `supports.*` to `supports.typography.*`. |
_excerpt_render_inner_blocks | Renders inner blocks from the allowed wrapper blocks for generating an excerpt. |
_filter_block_content_callback | Callback used for regular expression replacement in filter_block_content(). |
_restore_wpautop_hook | If do_blocks() needs to remove wpautop() from the `the_content` filter, this re-adds it afterwards, for subsequent `the_content` usage. |
_wp_filter_post_meta_footnotes | Strips all HTML from the content of footnotes, and sanitizes the ID. |
_wp_footnotes_force_filtered_html_on_import_filter | Initializes the filters for footnotes meta field when imported data should be filtered. |
_wp_footnotes_kses_init | Registers the filter of footnotes meta field if the user does not have `unfiltered_html` capability. |
_wp_footnotes_kses_init_filters | Adds the filters for footnotes meta field. |
_wp_footnotes_remove_filters | Removes the filters for footnotes meta field. |