Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-introduce data_wp_context() with _deprecated_function() call #59834

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,24 @@ function wp_interactivity_data_wp_context( array $context, string $store_namespa
'\'';
}
}

if ( ! function_exists( 'data_wp_context' ) ) {
/**
* `data_wp_context()` was renamed to follow WordPress Core naming schemes.
*
* @link https://github.com/WordPress/gutenberg/pull/59465/
* @link https://core.trac.wordpress.org/ticket/60575
*
* @since 6.5.0
* @deprecated 6.5.0
*
georgestephanis marked this conversation as resolved.
Show resolved Hide resolved
* @param array $context The array of context data to encode.
* @param string $store_namespace Optional. The unique store namespace identifier.
* @return string A complete `data-wp-context` directive with a JSON encoded value representing the context array and
* the store namespace if specified.
*/
function data_wp_context( array $context, string $store_namespace = '' ): string {
_deprecated_function( __FUNCTION__, '6.5', 'wp_interactivity_data_wp_context()' );
return wp_interactivity_data_wp_context( $context, $store_namespace );
}
}