serialize_block_attributes


serialize_block_attributes ( $block_attributes )

Parameters:
  • (array) block_attributes Attributes object.
Returns:
  • (string) Serialized attributes.
Defined at:

Description

Given an array of attributes, returns a string in the serialized attributes format prepared for post content.The serialized result is a JSON-encoded string, with unicode escape sequence substitution for characters which might otherwise interfere with embedding the result in an HTML comment. This function must produce output that remains in sync with the output of the serializeAttributes JavaScript function in the block editor in order to ensure consistent operation between PHP and JavaScript.

Related Functions

serialize_blocks, serialize_block, wp_pre_kses_block_attributes, wp_sanitize_script_attributes, wp_kses_uri_attributes

Top Google Results

User discussions

wpseek mobile