mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 14:50:29 +00:00
Editor: Introduce WP_Block_Bindings_Source class
Abstracts the block bindings source array into a well-defined object. Fixes #60447. See #60282. Follow-up [57373]. Props czapla, santosguillamot, gziolo. git-svn-id: https://develop.svn.wordpress.org/trunk@57562 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -270,9 +270,8 @@ class WP_Block {
|
||||
continue;
|
||||
}
|
||||
|
||||
$source_callback = $block_binding_source['get_value_callback'];
|
||||
$source_args = ! empty( $block_binding['args'] ) && is_array( $block_binding['args'] ) ? $block_binding['args'] : array();
|
||||
$source_value = call_user_func_array( $source_callback, array( $source_args, $this, $attribute_name ) );
|
||||
$source_args = ! empty( $block_binding['args'] ) && is_array( $block_binding['args'] ) ? $block_binding['args'] : array();
|
||||
$source_value = $block_binding_source->get_value( $source_args, $this, $attribute_name );
|
||||
|
||||
// If the value is not null, process the HTML based on the block and the attribute.
|
||||
if ( ! is_null( $source_value ) ) {
|
||||
|
||||
Reference in New Issue
Block a user