function wpcf7_welcome_panel()
{
    global $plugin_page;
    if ('wpcf7' != $plugin_page || !empty($_GET['post'])) {
        return;
    }
    $classes = 'welcome-panel';
    $vers = (array) get_user_meta(get_current_user_id(), 'wpcf7_hide_welcome_panel_on', true);
    if (wpcf7_version_grep(wpcf7_version('only_major=1'), $vers)) {
        $classes .= ' hidden';
    }
    ?>
<div id="welcome-panel" class="<?php 
    echo esc_attr($classes);
    ?>
">
	<?php 
    wp_nonce_field('wpcf7-welcome-panel-nonce', 'welcomepanelnonce', false);
    ?>
	<a class="welcome-panel-close" href="<?php 
    echo esc_url(menu_page_url('wpcf7', false));
    ?>
"><?php 
    echo esc_html(__('Dismiss', 'contact-form-7'));
    ?>
</a>

	<div class="welcome-panel-content">
		<div class="welcome-panel-column-container">
			<div class="welcome-panel-column">
				<h4><?php 
    echo esc_html(__('Contact Form 7 Needs Your Support', 'contact-form-7'));
    ?>
</h4>
				<p class="message"><?php 
    echo esc_html(__("It is hard to continue development and support for this plugin without contributions from users like you. If you enjoy using Contact Form 7 and find it useful, please consider making a donation.", 'contact-form-7'));
    ?>
</p>
				<p><?php 
    echo wpcf7_link(__('http://contactform7.com/donate/', 'contact-form-7'), __('Donate', 'contact-form-7'), array('class' => 'button button-primary'));
    ?>
</p>
			</div>

			<div class="welcome-panel-column">
				<h4><?php 
    echo esc_html(__('Get Started', 'contact-form-7'));
    ?>
</h4>
				<ul>
					<li><?php 
    echo wpcf7_link(__('http://contactform7.com/getting-started-with-contact-form-7/', 'contact-form-7'), __('Getting Started with Contact Form 7', 'contact-form-7'));
    ?>
</li>
					<li><?php 
    echo wpcf7_link(__('http://contactform7.com/admin-screen/', 'contact-form-7'), __('Admin Screen', 'contact-form-7'));
    ?>
</li>
					<li><?php 
    echo wpcf7_link(__('http://contactform7.com/tag-syntax/', 'contact-form-7'), __('How Tags Work', 'contact-form-7'));
    ?>
</li>
					<li><?php 
    echo wpcf7_link(__('http://contactform7.com/setting-up-mail/', 'contact-form-7'), __('Setting Up Mail', 'contact-form-7'));
    ?>
</li>
				</ul>
			</div>

			<div class="welcome-panel-column">
				<h4><?php 
    echo esc_html(__('Did You Know?', 'contact-form-7'));
    ?>
</h4>
				<ul>
					<li><?php 
    echo wpcf7_link(__('http://contactform7.com/spam-filtering-with-akismet/', 'contact-form-7'), __('Spam Filtering with Akismet', 'contact-form-7'));
    ?>
</li>
					<li><?php 
    echo wpcf7_link(__('http://contactform7.com/save-submitted-messages-with-flamingo/', 'contact-form-7'), __('Save Messages with Flamingo', 'contact-form-7'));
    ?>
</li>
					<li><?php 
    echo wpcf7_link(__('http://contactform7.com/selectable-recipient-with-pipes/', 'contact-form-7'), __('Selectable Recipient with Pipes', 'contact-form-7'));
    ?>
</li>
					<li><?php 
    echo wpcf7_link(__('http://contactform7.com/tracking-form-submissions-with-google-analytics/', 'contact-form-7'), __('Tracking with Google Analytics', 'contact-form-7'));
    ?>
</li>
				</ul>
			</div>
		</div>
	</div>
</div>
<?php 
}
Example #2
0
function wpcf7_admin_ajax_welcome_panel()
{
    check_ajax_referer('wpcf7-welcome-panel-nonce', 'welcomepanelnonce');
    $vers = get_user_meta(get_current_user_id(), 'wpcf7_hide_welcome_panel_on', true);
    if (empty($vers) || !is_array($vers)) {
        $vers = array();
    }
    if (empty($_POST['visible'])) {
        $vers[] = wpcf7_version('only_major=1');
    }
    $vers = array_unique($vers);
    update_user_meta(get_current_user_id(), 'wpcf7_hide_welcome_panel_on', $vers);
    wp_die(1);
}
Example #3
0
 function contact_form_tag_func($atts)
 {
     if (is_string($atts)) {
         $atts = explode(' ', $atts, 2);
     }
     $atts = (array) $atts;
     $id = (int) array_shift($atts);
     $contact_forms = $this->contact_forms();
     if (!($cf = $contact_forms[$id])) {
         return '[contact-form 404 "Not Found"]';
     }
     $cf = stripslashes_deep($cf);
     $this->unit_count += 1;
     $unit_tag = 'wpcf7-f' . $id . '-' . $this->processing_within . '-o' . $this->unit_count;
     $this->processing_unit_tag = $unit_tag;
     $form = '<div class="wpcf7" id="' . $unit_tag . '">';
     $url = parse_url($_SERVER['REQUEST_URI']);
     $url = $url['path'] . (empty($url['query']) ? '' : '?' . $url['query']) . '#' . $unit_tag;
     $form_elements = $this->form_elements($cf['form'], false);
     $multipart = false;
     foreach ($form_elements as $form_element) {
         if ('file' == $form_element['type']) {
             $multipart = true;
             break;
         }
     }
     $enctype = $multipart ? ' enctype="multipart/form-data"' : '';
     $form .= '<form action="' . $url . '" method="post" class="wpcf7-form"' . $enctype . '>';
     $form .= '<div style="display: none;">';
     $form .= '<input type="hidden" name="_wpcf7" value="' . $id . '" />';
     $form .= '<input type="hidden" name="_wpcf7_version" value="' . wpcf7_version() . '" />';
     $form .= '<input type="hidden" name="_wpcf7_unit_tag" value="' . $unit_tag . '" />';
     $form .= '</div>';
     $form .= $this->form_elements($cf['form']);
     $form .= '</form>';
     // Post response output for non-AJAX
     $class = 'wpcf7-response-output';
     if ($this->processing_unit_tag == $_POST['_wpcf7_unit_tag']) {
         if (isset($_POST['_wpcf7_mail_sent']) && $_POST['_wpcf7_mail_sent']['id'] == $id) {
             if ($_POST['_wpcf7_mail_sent']['ok']) {
                 $class .= ' wpcf7-mail-sent-ok';
                 $content = $_POST['_wpcf7_mail_sent']['message'];
             } else {
                 $class .= ' wpcf7-mail-sent-ng';
                 if ($_POST['_wpcf7_mail_sent']['spam']) {
                     $class .= ' wpcf7-spam-blocked';
                 }
                 $content = $_POST['_wpcf7_mail_sent']['message'];
             }
         } elseif (isset($_POST['_wpcf7_validation_errors']) && $_POST['_wpcf7_validation_errors']['id'] == $id) {
             $class .= ' wpcf7-validation-errors';
             $content = $this->message($cf, 'validation_error');
         }
     }
     $class = ' class="' . $class . '"';
     $form .= '<div' . $class . '>' . $content . '</div>';
     $form .= '</div>';
     $this->processing_unit_tag = null;
     if (WPCF7_AUTOP) {
         $form = $this->wpautop_substitute($form);
     }
     return $form;
 }