PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.13
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.13
1.1.13 1.1.12 1.1.11 1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 All 37 releases
← All changes | includes/window-links.php +21 -3 1.1.6 → 1.1.13 View file →
@@ -65,9 +65,9 @@
65 65 if ( $comment ) {
66 66 $identity = array(
67 67 'type' => 'comment',
68 68 'id' => (int) $comment->comment_ID,
69 - 'label' => wp_trim_words( $comment->comment_content, 10 ),
69 + 'label' => wp_trim_words( openstation_strip_all_tags( $comment->comment_content ), 10 ),
70 70 );
71 71
72 72 $post_id = (int) $comment->comment_post_ID;
73 73 $post_type = $post_id ? get_post_type( $post_id ) : false;
@@ -433,9 +433,12 @@
433 433 /**
434 434 * The related-entity pass: attach the `related` navigation items to a
435 435 * (post-identity-filter) content identity. Shared by the page-render
436 436 * builder above and the REST recompute endpoint the editor
437 - * save-watcher hits (where `$screen` is `null`).
437 + * save-watcher hits (where `$screen` is `null`). Also where the labels
438 + * become plain text: they name windows (Preview, Revisions, Related)
439 + * and are painted as text, where `get_the_title()`'s entities
440 + * (`’`) read literally.
438 441 *
439 442 * @internal
440 443 *
441 444 * @param array|null $identity Filtered identity, or `null`.
@@ -448,8 +451,11 @@
448 451 function openstation_window_related_attach( $identity, $post, $screen ) {
449 452 if ( ! is_array( $identity ) ) {
450 453 return $identity;
451 454 }
455 + if ( isset( $identity['label'] ) && is_string( $identity['label'] ) ) {
456 + $identity['label'] = openstation_plain_text_title( $identity['label'] );
457 + }
452 458
453 459 $related = array();
454 460 if (
455 461 $post instanceof WP_Post &&
@@ -814,8 +820,16 @@
814 820 foreach ( $related as $item ) {
815 821 if ( ! is_array( $item ) ) {
816 822 continue;
817 823 }
824 + // Plain text (see `openstation_window_related_attach()`),
825 + // decoded before the checks below so a label that was only
826 + // markup is dropped here rather than failing the whole ref.
827 + foreach ( array( 'label', 'groupLabel' ) as $text ) {
828 + if ( isset( $item[ $text ] ) && is_string( $item[ $text ] ) ) {
829 + $item[ $text ] = openstation_plain_text_title( $item[ $text ] );
830 + }
831 + }
818 832 foreach ( array( 'id', 'group', 'label', 'url' ) as $required ) {
819 833 // Mirror the JS engine's validation exactly (`.trim() !== ''`):
820 834 // a whitespace-only value passing here would fail validateRef
821 835 // client-side, which rejects the ref AS A UNIT — one bad item
@@ -851,9 +865,10 @@
851 865 *
852 866 * Recomputes a post's content identity — label, outbound `links`
853 867 * references, and the `related` navigation items — outside a page
854 868 * render. The chromeless bridge's editor save-watcher hits this
855 - * after every non-autosave Gutenberg save (Gutenberg saves over REST
869 + * after every non-autosave Gutenberg save, and after a new post's first
870 + * autosave (Gutenberg saves over REST
856 871 * without reloading, so the page-render announcement alone would go
857 872 * stale the moment the user adds a category or an image) and
858 873 * re-announces the fresh identity to the parent shell.
859 874 *
@@ -1086,8 +1101,11 @@
1086 1101 'scriptBefore' => $payload['before'],
1087 1102 'scriptAfter' => $payload['after'],
1088 1103 'scriptL10n' => $payload['l10n'],
1089 1104 'scriptTranslations' => $payload['translations'],
1105 + // The handle's dependency closure, replayed before the bundle
1106 + // on its lazy load — see `openstation_resolve_script_dependencies()`.
1107 + 'scriptDeps' => openstation_resolve_script_dependencies( $handle ),
1090 1108 );
1091 1109 $seen[ $handle ] = true;
1092 1110 }
1093 1111 return $out;