'
. \esc_html( $this->get_notice_text() )
. '
';
}
}
/**
* Shows a notice on the Block editor.
*
* @return void
*/
public function add_block_editor_notice() {
$post = \get_post();
if ( ! $post instanceof WP_Post ) {
return;
}
if ( $this->permissions_helper->has_original_changed( $post ) ) {
$notice = [
'text' => \wp_slash( $this->get_notice_text() ),
'status' => 'warning',
'isDismissible' => true,
];
\wp_add_inline_script(
'duplicate_post_edit_script',
"duplicatePostNotices.has_original_changed_notice = '" . \wp_json_encode( $notice ) . "';",
'before'
);
}
}
}