Skip to content

Commit 776b448

Browse files
Add link to copy notice
1 parent 0216915 commit 776b448

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/watchers/copied-post-watcher.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@ public function get_notice_text( $post ) {
5555

5656
$scheduled_copy = $this->permissions_helper->has_scheduled_rewrite_and_republish_copy( $post );
5757
if ( ! $scheduled_copy ) {
58-
return \__(
59-
'A duplicate of this post was made. Please note that any changes you make to this post will be replaced when the duplicated version is republished.',
60-
'duplicate-post'
58+
return \sprintf(
59+
\__(
60+
'A duplicate of this post was made: %1$s. Please note that any changes you make to this post will be replaced when the duplicated version is republished.',
61+
'duplicate-post'
62+
),
63+
'<a href="' .
64+
\get_edit_post_link( $this->permissions_helper->get_rewrite_and_republish_copy( $post )->ID )
65+
. '">link to copy</a>'
6166
);
6267
}
6368

@@ -90,7 +95,7 @@ public function add_admin_notice() {
9095

9196
if ( $this->permissions_helper->has_rewrite_and_republish_copy( $post ) ) {
9297
print '<div id="message" class="notice notice-warning is-dismissible fade"><p>'
93-
. \esc_html( $this->get_notice_text( $post ) )
98+
. $this->get_notice_text( $post )
9499
. '</p></div>';
95100
}
96101
}

0 commit comments

Comments
 (0)