Make WordPress Core


Ignore:
Timestamp:
03/04/2024 03:37:53 PM (14 months ago)
Author:
swissspidy
Message:

Interactivity API: Rename data_wp_context() to wp_interactivity_data_wp_context().

Increases clarity about where the function belongs to, bringing it in line with other related functions.

After initially merging this change in [57742] and reverting it in [57743], this reintroduces it now that the Gutenberg packages have been updated accordingly in [57760].

Props swissspidy, gziolo, cbravobernal, youknowriad, ankitmaru, westonruter, luisherranz, darerodz.
Fixes #60575.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/interactivity-api/interactivity-api.php

    r57743 r57762  
    150150 * Example:
    151151 *
    152  *     <div <?php echo data_wp_context( array( 'isOpen' => true, 'count' => 0 ) ); ?>>
     152 *     <div <?php echo wp_interactivity_data_wp_context( array( 'isOpen' => true, 'count' => 0 ) ); ?>>
    153153 *
    154154 * @since 6.5.0
     
    159159 *                the store namespace if specified.
    160160 */
    161 function data_wp_context( array $context, string $store_namespace = '' ): string {
     161function wp_interactivity_data_wp_context( array $context, string $store_namespace = '' ): string {
    162162    return 'data-wp-context=\'' .
    163163        ( $store_namespace ? $store_namespace . '::' : '' ) .
Note: See TracChangeset for help on using the changeset viewer.