function clean_contact($atts)
{
    if (!is_page() or is_single()) {
        return;
    }
    if (!get_option('clean_contact_nocss')) {
        $html = clean_contact_css();
    }
    $html .= clean_contact_strings();
    $html .= '<a name="clean_contact"></a><script src="' . WP_PLUGIN_URL . '/clean-contact/fieldset.js" type="text/javascript"></script>';
    $thanks = !empty($atts['thanks']) ? $atts['thanks'] : get_option('clean_contact_thanks');
    $thanks_url = !empty($atts['thanks_url']) ? $atts['thanks_url'] : get_option('clean_contact_thanks_url');
    if (empty($thanks)) {
        $thanks = __('Thank you. Message sent!');
    }
    if ($atts['sent']) {
        if ($thanks_url) {
            $html .= "<script>clean_contact_url('{$thanks_url}');</script>" . "\n";
        } else {
            $html .= '<div class="CleanContact_msg ok">' . $thanks . '</div>';
        }
    } elseif ($atts['fail']) {
        $html .= '<p class="CleanContact_msg err">' . __('Sorry, unable to deliver this message') . '</p>';
    } else {
        $html .= '<script type="text/javascript">clean_contact_form();</script>' . "\n";
    }
    $html .= '<noscript><p class="CleanContact_msg err">' . __('Sorry, due to anti-spam measures, this contact form requires that javascript be enabled on your browser.') . '</p></noscript>';
    return $html;
}
Пример #2
0
function clean_contact($atts)
{
    if (is_archive()) {
        return;
    }
    if (!cc_get_option('clean_contact_nocss')) {
        $html = clean_contact_css();
    } else {
        $html = '';
    }
    $html .= clean_contact_strings();
    $html .= '<a name="clean_contact"></a><script src="' . get_template_directory_uri() . '/lib/clean-contact/fieldset.js" type="text/javascript"></script>';
    $thanks = !empty($atts['thanks']) ? $atts['thanks'] : cc_get_option('clean_contact_thanks');
    $thanks_url = !empty($atts['thanks_url']) ? $atts['thanks_url'] : cc_get_option('clean_contact_thanks_url');
    if (empty($thanks)) {
        $thanks = __('Thank you. Message sent!', 'largo');
    }
    if ($atts['sent']) {
        if ($thanks_url) {
            $html .= "<script>clean_contact_url('{$thanks_url}');</script>" . "\n";
        } else {
            $html .= '<div class="CleanContact_msg ok">' . esc_html($thanks) . '</div>';
        }
    } else {
        if ($atts['fail']) {
            $html .= '<p class="CleanContact_msg err">' . __('Sorry, unable to deliver this message', 'largo') . '</p>';
        } else {
            $html .= '<script type="text/javascript">clean_contact_form();</script>' . "\n";
        }
    }
    $html .= '<noscript><p class="CleanContact_msg err">' . __('Sorry, due to anti-spam measures, this contact form requires that javascript be enabled on your browser.', 'largo') . '</p></noscript>';
    return $html;
}