PluginProbe
Gutenberg / 22.7.0
Gutenberg v22.7.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← All changes | lib/experimental/blocks.php +21 -0 24.0.022.7.0 View file →
@@ -116,4 +116,25 @@
116 116 }
117 117
118 118 return $result;
119 119 }
120 +
121 +/**
122 + * Additional data to expose to the view script module in the Form block.
123 + *
124 + * @return array The script module data.
125 + */
126 +function gutenberg_block_core_form_view_script_module( $data ) {
127 + if ( ! gutenberg_is_experiment_enabled( 'gutenberg-form-blocks' ) ) {
128 + return $data;
129 + }
130 +
131 + $data['nonce'] = wp_create_nonce( 'wp-block-form' );
132 + $data['ajaxUrl'] = admin_url( 'admin-ajax.php' );
133 + $data['action'] = 'wp_block_form_email_submit';
134 +
135 + return $data;
136 +}
137 +add_filter(
138 + 'script_module_data_@wordpress/block-library/form/view',
139 + 'gutenberg_block_core_form_view_script_module'
140 +);