child_branding_options; if ( isset( $_POST['submit'] ) ) { if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], '_contactNonce' ) ) { return false; } $this->render_submit_message( $opts ); return; } $from_page = ''; if ( isset( $_GET['from_page'] ) ) { $from_page = rawurldecode( $_GET['from_page'] ); } else { $protocol = isset( $_SERVER['HTTPS'] ) && strcasecmp( $_SERVER['HTTPS'], 'off' ) ? 'https://' : 'http://'; $fullurl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $from_page = rawurldecode( $fullurl ); } $support_message = $opts['support_message']; $support_message = nl2br( stripslashes( $support_message ) ); $from_email = $current_user ? $current_user->user_email : ''; ?>
' . esc_html( $back_link ) . '' : ''; if ( $this->send_support_mail() ) { $send_email_message = isset( $opts['send_email_message'] ) ? $opts['send_email_message'] : ''; if ( ! empty( $send_email_message ) ) { $send_email_message = stripslashes( $send_email_message ); } else { $send_email_message = __( 'Message has been submitted successfully.', 'mainwp-child' ); } } else { $send_email_message = __( 'Sending email failed!', 'mainwp-child' ); } ?> get_branding_options(); $email = $opts['support_email']; $sub = wp_kses_post( nl2br( stripslashes( $_POST['mainwp_branding_contact_message_subject'] ) ) ); $from = trim( $_POST['mainwp_branding_contact_send_from'] ); $subject = ! empty( $sub ) ? $sub : 'MainWP - Support Contact'; $content = wp_kses_post( nl2br( stripslashes( $_POST['mainwp_branding_contact_message_content'] ) ) ); $mail = ''; $headers = ''; if ( ! empty( $_POST['mainwp_branding_contact_message_content'] ) && ! empty( $email ) ) { global $current_user; $headers .= "Content-Type: text/html;charset=utf-8\r\n"; if ( ! empty( $from ) ) { $headers .= 'From: "' . $from . '" <' . $from . ">\r\n"; } $mail .= "Support Email from: " . site_url() . "
\r\n\r\n"; $mail .= 'Sent from WordPress page: ' . ( ! empty( $_POST['mainwp_branding_send_from_page'] ) ? "" . esc_url( $_POST['mainwp_branding_send_from_page'] ) . "
\r\n\r\n" : '' ); $mail .= 'Client Email: ' . $current_user->user_email . "
\r\n\r\n"; $mail .= "Support Text:
\r\n\r\n"; $mail .= '' . $content . "
\r\n\r\n"; wp_mail( $email, $subject, $mail, $headers ); return true; } return false; } /** * After admin bar render. */ public function after_admin_bar_render() { $hide_slugs = apply_filters( 'mainwp_child_hide_update_notice', array() ); if ( ! is_array( $hide_slugs ) ) { $hide_slugs = array(); } if ( 0 == count( $hide_slugs ) ) { return; } if ( ! function_exists( '\get_plugin_updates' ) ) { include_once ABSPATH . '/wp-admin/includes/update.php'; } $count_hide = 0; $updates = get_plugin_updates(); if ( is_array( $updates ) ) { foreach ( $updates as $slug => $data ) { if ( in_array( $slug, $hide_slugs ) ) { $count_hide++; } } } if ( 0 == $count_hide ) { return; } ?> $data ) { if ( in_array( $slug, $hide_slugs ) ) { $count_hide++; } } } if ( 0 == $count_hide ) { return; } ?>