Make WordPress Core


Ignore:
Timestamp:
02/08/2024 08:55:18 AM (3 months ago)
Author:
gziolo
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-bindings.php

    r57560 r57562  
    8989 *                                        the block's original value, null, false to remove an attribute, etc.
    9090 * }
    91  * @return array|false Source when the registration was successful, or `false` on failure.
     91 * @return WP_Block_Bindings_Source|false Source when the registration was successful, or `false` on failure.
    9292 */
    9393function register_block_bindings_source( string $source_name, array $source_properties ) {
     
    101101 *
    102102 * @param string $source_name Block bindings source name including namespace.
    103  * @return array|false The unregistered block bindings source on success and `false` otherwise.
     103 * @return WP_Block_Bindings_Source|false The unregistered block bindings source on success and `false` otherwise.
    104104 */
    105105function unregister_block_bindings_source( string $source_name ) {
     
    112112 * @since 6.5.0
    113113 *
    114  * @return array The array of registered block bindings sources.
     114 * @return WP_Block_Bindings_Source[] The array of registered block bindings sources.
    115115 */
    116116function get_all_registered_block_bindings_sources() {
     
    124124 *
    125125 * @param string $source_name The name of the source.
    126  * @return array|null The registered block bindings source, or `null` if it is not registered.
     126 * @return WP_Block_Bindings_Source|null The registered block bindings source, or `null` if it is not registered.
    127127 */
    128128function get_block_bindings_source( string $source_name ) {
Note: See TracChangeset for help on using the changeset viewer.