Skip to content

Commit

Permalink
Improve example
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 11, 2024
1 parent 73e4d19 commit 8d0985a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wp-includes/class-wp-script-modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ public function print_script_module_data(): void {
* add_filter(
* 'script_module_data_MyScriptModuleID',
* function ( array $data ): array {
* $data['script-needs-this-data'] = 'ok';
* $data['dataForClient'] = 'ok';
* return $data;
* }
* );
Expand All @@ -433,6 +433,7 @@ public function print_script_module_data(): void {
* data = JSON.parse( dataContainer.textContent );
* } catch {}
* }
* // data.dataForClient === 'ok';
* initMyScriptModuleWithData( data );
*
* @since 6.7.0
Expand Down

0 comments on commit 8d0985a

Please sign in to comment.