Skip to content

Commit

Permalink
Fixed newsletter component showing up on screens where it shouldn't.
Browse files Browse the repository at this point in the history
  • Loading branch information
Majed-Habli committed Apr 4, 2024
1 parent ba750ca commit 37fb852
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions public/includes/da-newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public function __construct( $parent ) {

add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_meta_box_assets' ) );
add_action( 'admin_footer', array( $this, 'newsletter_modal_dialog' ) );
// add_action( 'admin_footer', array( $this, 'newsletter_modal_dialog' ), 10, 1 );

add_action( 'add_meta_boxes', array( $this, 'add_newsletter_widget' ) );

// Order the meta boxes
Expand Down Expand Up @@ -45,6 +47,12 @@ public function metabox_newsletter_component() {
}

public function newsletter_modal_dialog() {
$current_screen = get_current_screen();

if ( ! $current_screen || 'post' !== $current_screen->base || 'da_image' !== $current_screen->post_type ) {
return;
}

echo "
<div id='_news_letter_modal' class='modal' role='dialog' aria-labelledby='weeklyNewsLetterHeader'>
<div class='modal-content modal-content-container'>
Expand Down

0 comments on commit 37fb852

Please sign in to comment.