Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Do a is_admin() check to only load elements in admin area #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions wpsendgrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,20 @@ function wp_mail_already_declared_notice()
Sendgrid_Tools::set_mc_widget_notice_dismissed( 'true' );
}

// Display widget notice
if ( 'true' != Sendgrid_Tools::get_mc_widget_notice_dismissed() and
( !is_multisite() or ( is_multisite() and ( get_option( 'sendgrid_can_manage_subsite' ) or is_main_site() ) ) ) ) {
add_action( 'admin_notices', 'sg_subscription_widget_admin_notice' );
}
if ( is_admin() ) {

// Display widget notice
if ( 'true' != Sendgrid_Tools::get_mc_widget_notice_dismissed() and
( !is_multisite() or ( is_multisite() and ( get_option( 'sendgrid_can_manage_subsite' ) or is_main_site() ) ) ) ) {
add_action( 'admin_notices', 'sg_subscription_widget_admin_notice' );
}

// Initialize SendGrid Settings
new Sendgrid_Settings( plugin_basename( __FILE__ ) );
// Initialize SendGrid Settings
new Sendgrid_Settings( plugin_basename( __FILE__ ) );

// Initialize SendGrid Statistics
new Sendgrid_Statistics();
// Initialize SendGrid Statistics
new Sendgrid_Statistics();
}

// Initialize SendGrid Filters
new Sendgrid_Filters();