Skip to content

Commit 90a2cab

Browse files
committed
Docs: Update parameter types to allow null for interactivity api functions
When [58327] added annotations for a nullable-typed argument in the Interactivity API, the PHPDoc comment wasn’t also updated. This patch adds the corresponding documentation update. Prepared ahead of WCEU 2026, merged as part of Contributor Day. Developed in: WordPress#11470 Discussed in: https://core.trac.wordpress.org/ticket/65404 Follow-up to [58327]. Props audrasjb, mukesh27, soean. Fixes #65404. git-svn-id: https://develop.svn.wordpress.org/trunk@62458 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0b4e8eb commit 90a2cab

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/wp-includes/interactivity-api/class-wp-interactivity-api.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ final class WP_Interactivity_API {
138138
* @since 6.5.0
139139
* @since 6.6.0 The `$store_namespace` param is optional.
140140
*
141-
* @param string $store_namespace Optional. The unique store namespace identifier.
142-
* @param array $state Optional. The array that will be merged with the existing state for the specified
141+
* @param string|null $store_namespace Optional. The unique store namespace identifier.
142+
* @param array|null $state Optional. The array that will be merged with the existing state for the specified
143143
* store namespace.
144144
* @return array The current state for the specified store namespace. This will be the updated state if a $state
145145
* argument was provided.
@@ -311,7 +311,7 @@ public function filter_script_module_interactivity_data( array $data ): array {
311311
*
312312
* @since 6.6.0
313313
*
314-
* @param string $store_namespace Optional. The unique store namespace identifier.
314+
* @param string|null $store_namespace Optional. The unique store namespace identifier.
315315
*/
316316
public function get_context( ?string $store_namespace = null ): array {
317317
if ( null === $this->context_stack ) {

src/wp-includes/interactivity-api/interactivity-api.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function wp_interactivity_process_directives( string $html ): string {
5353
* @since 6.5.0
5454
* @since 6.6.0 The namespace can be omitted when called inside derived state getters.
5555
*
56-
* @param string $store_namespace The unique store namespace identifier.
57-
* @param array $state Optional. The array that will be merged with the existing state for the specified
58-
* store namespace.
56+
* @param string|null $store_namespace The unique store namespace identifier.
57+
* @param array $state Optional. The array that will be merged with the existing state for the specified
58+
* store namespace.
5959
* @return array The state for the specified store namespace. This will be the updated state if a $state argument was
6060
* provided.
6161
*/
@@ -119,7 +119,7 @@ function wp_interactivity_data_wp_context( array $context, string $store_namespa
119119
*
120120
* @since 6.6.0
121121
*
122-
* @param string $store_namespace Optional. The unique store namespace identifier.
122+
* @param string|null $store_namespace Optional. The unique store namespace identifier.
123123
* @return array The context for the specified store namespace.
124124
*/
125125
function wp_interactivity_get_context( ?string $store_namespace = null ): array {

0 commit comments

Comments
 (0)