trial->is_trial_valid() || ES()->is_premium() ) { // Add UI for CSS inliner only if service is valid. if ( ES()->validate_service_request( array( 'css_inliner' ) ) ) { add_action( 'ig_es_after_campaign_left_pan_settings', array( &$this, 'add_custom_css_field' ) ); add_action( 'ig_es_after_template_left_pan_settings', array( &$this, 'add_custom_css_field' ) ); add_action( 'edit_form_after_editor', array( &$this, 'add_custom_css_block' ), 11, 2 ); add_action( 'save_post', array( &$this, 'update_template' ), 10, 2 ); } // Add UI for spam score check only if service is valid. if ( ES()->validate_service_request( array( 'spam_score_check' ) ) ) { add_action( 'add_meta_boxes', array( &$this, 'add_metaboxes' ) ); add_action( 'ig_es_after_campaign_right_pan_settings', array( &$this, 'add_check_spam_score_button' ) ); add_action( 'ig_es_after_campaign_right_pan_settings', array( &$this, 'add_check_email_authentication_button' ) ); } // Add UI for utm tracking only if service is valid. if ( ES()->validate_service_request( array( 'utm_tracking' ) ) ) { add_action( 'add_meta_boxes', array( &$this, 'register_utm_tracking_metabox' ) ); add_action( 'ig_es_save_template', array( &$this, 'save_utm_campaign' ), 10, 2 ); add_action( 'ig_es_after_broadcast_tracking_options_settings', array( &$this, 'add_utm_tracking_option' ) ); add_action( 'ig_es_after_campaign_tracking_options_settings', array( &$this, 'add_utm_tracking_option' ) ); add_filter( 'ig_es_registered_settings', array( &$this, 'add_utm_tracking_option_in_settings' ) ); } } } /** * Method to add custom CSS field in the campaign screen * * @param array $campaign_data * @return void */ public function add_custom_css_field( $campaign_data ) { $is_campaign_page = doing_action( 'ig_es_after_campaign_left_pan_settings' ); if ( $is_campaign_page ) { $editor_type_meta_key = 'editor_type'; } else { $editor_type_meta_key = 'es_editor_type'; } $editor_type = ! empty( $campaign_data['meta'][$editor_type_meta_key] ) ? $campaign_data['meta'][$editor_type_meta_key] : IG_ES_DRAG_AND_DROP_EDITOR; if ( IG_ES_CLASSIC_EDITOR === $editor_type ) { $custom_css = ! empty( $campaign_data['meta']['es_custom_css'] ) ? $campaign_data['meta']['es_custom_css'] : ''; $custom_css_field_name = $is_campaign_page ? 'data[meta][es_custom_css]' : 'data[meta][es_custom_css]'; $is_trial_valid = ES()->trial->is_trial_valid(); ?>
post_type ) { return; } $es_custom_css = ''; if ( 'post-new.php' != $pagenow ) { $es_custom_css = get_post_meta( $post->ID, 'es_custom_css', true ); } ?>


post_type ) { return; } if ( ! empty( $_POST['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), 'update-post_' . $post_id ) ) { // Get custom CSS code. Don't sanitize it since it removes CSS code. $es_custom_css = ig_es_get_data( $_POST, 'es_custom_css', false, false ); if ( false !== $es_custom_css ) { update_post_meta( $post_id, 'es_custom_css', $es_custom_css ); } /** * Save ES Template action * * @since 4.3.1 */ do_action( 'ig_es_save_template', $post_id, $post_id ); } } /** * Method to add metaboxes * * @since 4.6.1 */ public function add_metaboxes() { add_meta_box( 'es_spam', __( 'Get Spam Score', 'email-subscribers' ), array( &$this, 'add_spam_score_metabox' ), 'es_template', 'side', 'default' ); } /** * Method to add spam score metabox * * @since 4.6.1 */ public function add_spam_score_metabox() { global $post; ?> trial->is_trial_valid(); ?>
trial->is_trial_valid(); $url = admin_url(); $headers = get_option('ig_es_email_auth_headers', []); ?>
trial->is_trial_valid(); ?>
ID, 'es_utm_campaign', true ); $es_utm_campaign = ! empty( $es_utm_campaign ) ? $es_utm_campaign : ''; $allowedtags = ig_es_allowed_html_tags_in_esc(); add_filter( 'safe_style_css', 'ig_es_allowed_css_style' ); /* translators: 1: UTM parameters */ $tooltip_html = ES_Common::get_tooltip_html( sprintf( __( 'This will be appended to every URL in this template with parameters: %s', 'email-subscribers' ), 'utm_source=es&utm_medium=email&utm_campaign=campaign_name' ) ); ?>

array( 'id' => 'ig_es_track_utm', 'name' => __( 'Google Analytics UTM tracking', 'email-subscribers' ), 'info' => __( 'Do you want to automatically add campaign tracking parameters in emails to track performance in Google Analytics? (We recommend keeping it enabled)', 'email-subscribers' ), 'type' => 'checkbox', 'default' => 'no', ), ); $general_fields = $fields['general']; $general_fields = ig_es_array_insert_after( $general_fields, 'ig_es_track_link_click', $track_utm ); $fields['general'] = $general_fields; return $fields; } } }