Fetch postId from the backend and remove reliance on getting the post id from the URL

MAILPOET-6430
This commit is contained in:
Oluwaseun Olorunsola
2025-01-28 23:14:41 +01:00
committed by Oluwaseun Olorunsola
parent a49b978050
commit 6a012a8dd6
4 changed files with 6 additions and 4 deletions

View File

@@ -317,7 +317,8 @@ class Email_Editor {
?>
<script type="text/javascript"> <?php // phpcs:ignore ?>
window.mailpoet_email_editor_current_post_type = <?php echo wp_json_encode( $email_editor_current_post_type ); ?>;
window.mailpoet_email_editor_current_post_type = '<?php echo esc_js( $email_editor_current_post_type ); ?>';
window.mailpoet_email_editor_current_post_id = <?php echo esc_js( $post->ID ); ?>;
</script>
<?php
}