@wordpress/block-library 8.12.14 → 8.12.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/footnotes/index.php +7 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.15",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@wordpress/blocks": "^12.12.7",
|
|
42
42
|
"@wordpress/components": "^25.1.10",
|
|
43
43
|
"@wordpress/compose": "^6.12.2",
|
|
44
|
-
"@wordpress/core-data": "^6.12.
|
|
44
|
+
"@wordpress/core-data": "^6.12.13",
|
|
45
45
|
"@wordpress/data": "^9.5.5",
|
|
46
46
|
"@wordpress/date": "^4.35.1",
|
|
47
47
|
"@wordpress/deprecated": "^3.35.1",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@wordpress/notices": "^4.3.5",
|
|
57
57
|
"@wordpress/primitives": "^3.33.1",
|
|
58
58
|
"@wordpress/private-apis": "^0.17.2",
|
|
59
|
-
"@wordpress/reusable-blocks": "^4.12.
|
|
59
|
+
"@wordpress/reusable-blocks": "^4.12.13",
|
|
60
60
|
"@wordpress/rich-text": "^6.12.7",
|
|
61
61
|
"@wordpress/server-side-render": "^4.12.12",
|
|
62
62
|
"@wordpress/url": "^3.36.1",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "cfdd2a100c5301e4b37123b21e3499f48a6fcbaf"
|
|
87
87
|
}
|
package/src/footnotes/index.php
CHANGED
|
@@ -34,7 +34,7 @@ function render_block_core_footnotes( $attributes, $content, $block ) {
|
|
|
34
34
|
|
|
35
35
|
$footnotes = json_decode( $footnotes, true );
|
|
36
36
|
|
|
37
|
-
if ( count( $footnotes ) === 0 ) {
|
|
37
|
+
if ( ! is_array( $footnotes ) || count( $footnotes ) === 0 ) {
|
|
38
38
|
return '';
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -98,7 +98,7 @@ function wp_save_footnotes_meta( $revision_id ) {
|
|
|
98
98
|
|
|
99
99
|
if ( $footnotes ) {
|
|
100
100
|
// Can't use update_post_meta() because it doesn't allow revisions.
|
|
101
|
-
update_metadata( 'post', $revision_id, 'footnotes', $footnotes );
|
|
101
|
+
update_metadata( 'post', $revision_id, 'footnotes', wp_slash( $footnotes ) );
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -154,15 +154,14 @@ function wp_add_footnotes_revisions_to_post_meta( $post ) {
|
|
|
154
154
|
|
|
155
155
|
if ( $footnotes ) {
|
|
156
156
|
// Can't use update_post_meta() because it doesn't allow revisions.
|
|
157
|
-
update_metadata( 'post', $wp_temporary_footnote_revision_id, 'footnotes', $footnotes );
|
|
157
|
+
update_metadata( 'post', $wp_temporary_footnote_revision_id, 'footnotes', wp_slash( $footnotes ) );
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
163
|
+
add_action( 'rest_after_insert_post', 'wp_add_footnotes_revisions_to_post_meta' );
|
|
164
|
+
add_action( 'rest_after_insert_page', 'wp_add_footnotes_revisions_to_post_meta' );
|
|
166
165
|
|
|
167
166
|
/**
|
|
168
167
|
* Restores the footnotes meta value from the revision.
|
|
@@ -176,7 +175,7 @@ function wp_restore_footnotes_from_revision( $post_id, $revision_id ) {
|
|
|
176
175
|
$footnotes = get_post_meta( $revision_id, 'footnotes', true );
|
|
177
176
|
|
|
178
177
|
if ( $footnotes ) {
|
|
179
|
-
update_post_meta( $post_id, 'footnotes', $footnotes );
|
|
178
|
+
update_post_meta( $post_id, 'footnotes', wp_slash( $footnotes ) );
|
|
180
179
|
} else {
|
|
181
180
|
delete_post_meta( $post_id, 'footnotes' );
|
|
182
181
|
}
|
|
@@ -243,7 +242,7 @@ function _wp_rest_api_autosave_meta( $autosave ) {
|
|
|
243
242
|
return;
|
|
244
243
|
}
|
|
245
244
|
|
|
246
|
-
update_post_meta( $id, 'footnotes', $body['meta']['footnotes'] );
|
|
245
|
+
update_post_meta( $id, 'footnotes', wp_slash( $body['meta']['footnotes'] ) );
|
|
247
246
|
}
|
|
248
247
|
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L391C1-L391C1.
|
|
249
248
|
add_action( 'wp_creating_autosave', '_wp_rest_api_autosave_meta' );
|