public function add_meta_box() { if (strstr($_SERVER['REQUEST_URI'], 'post-new.php')) { return false; } $existing = mailchimp_tools_get_existing_campaign_data_for_post(get_post($_GET['post'])); if (!$existing) { return false; } parent::add_meta_box(); }
public function enqueue_assets() { parent::enqueue_assets(); wp_register_script('mailchimp-tools-campaign-edit', MAILCHIMP_TOOLS_DIR_URI . '/assets/js/campaign-edit.js', array('mailchimp-tools-campaign-common'), MAILCHIMP_TOOLS_VER, true); $screen = get_current_screen(); if ($screen->post_type == $this->post_type && $screen->base == 'post') { wp_enqueue_script('mailchimp-tools-campaign-edit'); } }