'
. \esc_html(
/* translators: %s: Number of posts copied. */
\_n(
'%s item copied.',
'%s items copied.',
$copied_posts,
'duplicate-post'
)
) . '
',
\esc_html( $copied_posts )
);
}
}
/**
* Shows a notice in Classic editor after the Rewrite & Republish action via link has succeeded.
*
* @return void
*/
public function add_rewrite_and_republish_admin_notice() {
if ( ! empty( $_REQUEST['rewriting'] ) ) {
if ( ! $this->permissions_helper->is_classic_editor() ) {
return;
}
print ''
. \esc_html__(
'You can now start rewriting your post in this duplicate of the original post. If you click "Republish", your changes will be merged into the original post and you’ll be redirected there.',
'duplicate-post'
) . '
';
}
}
/**
* Shows a notice on the Block editor after the Rewrite & Republish action via link has succeeded.
*
* @return void
*/
public function add_rewrite_and_republish_block_editor_notice() {
if ( ! empty( $_REQUEST['rewriting'] ) ) {
$notice = [
'text' => \wp_slash(
\__(
'You can now start rewriting your post in this duplicate of the original post. If you click "Republish", this rewritten post will replace the original post.',
'duplicate-post'
)
),
'status' => 'warning',
'isDismissible' => true,
];
\wp_add_inline_script(
'duplicate_post_edit_script',
"duplicatePostNotices.rewriting_notice = '" . \wp_json_encode( $notice ) . "';",
'before'
);
}
}
}