| Server IP : 27.254.66.5 / Your IP : 216.73.217.39 Web Server : Apache/2 System : Linux cs82.hostneverdie.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64 User : technic2 ( 1951) PHP Version : 7.4.30 Disable Function : apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd,exec, fp, fput, highlight_file, ini_alter, ini_restore, inject_code, passthru,phpAds_remoteInfo, phpAds_XmlRpc,phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid,posix_setuid, posix_setuid, posix_uname,proc_open,proc_close, proc_get_status, proc_nice, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode, show_source,sleep,pcntl_exec,virtual,suexec,dbmopen,dl,symlink,disk_free_space,diskfreespace,leak MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/technic2/public_html/old-website/wp-content/plugins/jetpack/modules/widgets/ |
Upload File : |
<?php
if ( ! class_exists( 'Jetpack_MailChimp_Subscriber_Popup_Widget' ) ) {
if ( ! class_exists( 'MailChimp_Subscriber_Popup' ) ) {
include_once JETPACK__PLUGIN_DIR . 'modules/shortcodes/mailchimp.php';
}
//register MailChimp Subscriber Popup widget
function jetpack_mailchimp_subscriber_popup_widget_init() {
register_widget( 'Jetpack_MailChimp_Subscriber_Popup_Widget' );
}
add_action( 'widgets_init', 'jetpack_mailchimp_subscriber_popup_widget_init' );
/**
* Add a MailChimp subscription form.
*/
class Jetpack_MailChimp_Subscriber_Popup_Widget extends WP_Widget {
/**
* Constructor
*/
function __construct() {
parent::__construct(
'widget_mailchimp_subscriber_popup',
/** This filter is documented in modules/widgets/facebook-likebox.php */
apply_filters( 'jetpack_widget_name', __( 'MailChimp Subscriber Popup', 'jetpack' ) ),
array(
'classname' => 'widget_mailchimp_subscriber_popup',
'description' => __( 'Allows displaying a popup subscription form to visitors.', 'jetpack' ),
'customize_selective_refresh' => true,
)
);
}
/**
* Outputs the HTML for this widget.
*
* @param array $args An array of standard parameters for widgets in this theme
* @param array $instance An array of settings for this widget instance
*
* @return void Echoes it's output
**/
function widget( $args, $instance ) {
$instance = wp_parse_args( $instance, array( 'code' => '' ) );
// Regular expresion that will match maichimp shortcode.
$regex = "(\[mailchimp_subscriber_popup[^\]]+\])";
// Check if the shortcode exists.
preg_match( $regex, $instance['code'], $matches );
// Process the shortcode only, if exists.
if ( ! empty( $matches[0] ) ) {
echo do_shortcode( $matches[0] );
}
/** This action is documented in modules/widgets/gravatar-profile.php */
do_action( 'jetpack_stats_extra', 'widget_view', 'mailchimp_subscriber_popup' );
}
/**
* Deals with the settings when they are saved by the admin.
*
* @param array $new_instance New configuration values
* @param array $old_instance Old configuration values
*
* @return array
*/
function update( $new_instance, $old_instance ) {
$instance = array();
$instance['code'] = MailChimp_Subscriber_Popup::reversal( $new_instance['code'] );
return $instance;
}
/**
* Displays the form for this widget on the Widgets page of the WP Admin area.
*
* @param array $instance Instance configuration.
*
* @return void
*/
function form( $instance ) {
$instance = wp_parse_args( $instance, array( 'code' => '' ) );
?>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'code' ) ); ?>">
<?php printf( __( 'Code: <a href="%s" target="_blank">( ? )</a>', 'jetpack' ), 'https://en.support.wordpress.com/mailchimp/' ); ?>
</label>
<textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'code' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'code' ) ); ?>" rows="3"><?php echo esc_textarea( $instance['code'] ); ?></textarea>
</p>
<?php
}
}
}