'widget_thrive_optin', 'description' => __( 'Get more subscribers for your newsletter/mailing list.', 'thrive' ) ); parent::__construct( 'widget_thrive_optin', __( 'Thrive Opt-in Widget', 'thrive' ), $widget_ops ); $this->alt_option_name = 'widget_thrive_optin'; add_action( 'save_post', array( &$this, 'flush_widget_cache' ) ); add_action( 'deleted_post', array( &$this, 'flush_widget_cache' ) ); add_action( 'switch_theme', array( &$this, 'flush_widget_cache' ) ); } function widget( $args, $instance ) { if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = "widget-thrive" . rand( 0, 999 ); } $widget_container_class = strtolower( $instance['color'] ) . "_cta"; if ( ! isset( $instance['optin'] ) || ( isset( $instance['optin'] ) && ! get_post( $instance['optin'] ) ) ) { echo "There are some problems with the configuration of the opt-in widget"; return; } //form action $optinFormAction = get_post_meta( $instance['optin'], '_thrive_meta_optin_form_action', true ); //form method $optinFormMethod = get_post_meta( $instance['optin'], '_thrive_meta_optin_form_method', true ); $optinFormMethod = strtolower( $optinFormMethod ); $optinFormMethod = $optinFormMethod === 'post' || $optinFormMethod === 'get' ? $optinFormMethod : 'post'; //form hidden inputs $optinHiddenInputs = get_post_meta( $instance['optin'], '_thrive_meta_optin_hidden_inputs', true ); //form fields $optinFieldsJson = get_post_meta( $instance['optin'], '_thrive_meta_optin_fields_array', true ); $optinFieldsArray = json_decode( $optinFieldsJson, true ); //form not visible inputs $optinNotVisibleInputs = get_post_meta( $instance['optin'], '_thrive_meta_optin_not_visible_inputs', true ); if ( ! is_array( $optinFieldsArray ) ) { echo "There are some problems with the configuration of the opt-in widget"; return; } ?>


$field_label ): ?> getInputHtml( $name_attr, $field_label ) ?>
flush_widget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); if ( isset( $alloptions['widget_thrive_optin'] ) ) { delete_option( 'widget_thrive_optin' ); } return $instance; } function flush_widget_cache() { wp_cache_delete( 'widget_thrive_optin', 'widget' ); } function form( $instance ) { $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $color = isset( $instance['color'] ) ? esc_attr( $instance['color'] ) : ''; $headline_text = isset( $instance['headline_text'] ) ? esc_attr( $instance['headline_text'] ) : ''; $body_text = isset( $instance['body_text'] ) ? esc_attr( $instance['body_text'] ) : ''; $button_text = isset( $instance['button_text'] ) ? esc_attr( $instance['button_text'] ) : ''; $custom_image = isset( $instance['custom_image'] ) ? esc_attr( $instance['custom_image'] ) : ''; $optin = isset( $instance['optin'] ) ? absint( $instance['optin'] ) : 0; $queryOptins = new WP_Query( "post_type=thrive_optin&order=ASC&post_status=publish&posts_per_page=-1" ); $all_colors = _thrive_get_color_scheme_options( "optin" ); ?>

_btn_upload' value=''/>