function spyropress_deregister_cf7() { wp_dequeue_style('contact-form-7'); if (function_exists('wpcf7_is_rtl') && wpcf7_is_rtl()) { wp_dequeue_style('contact-form-7-rtl'); } }
function wpcf7c_enqueue_styles() { wp_enqueue_style('contact-form-7-confirm', wpcf7c_plugin_url('includes/css/styles.css'), array(), WPCF7C_VERSION, 'all'); if (wpcf7_is_rtl()) { wp_enqueue_style('contact-form-7-confirm-rtl', wpcf7c_plugin_url('includes/css/styles-rtl.css'), array(), WPCF7_VERSION, 'all'); } }
function wpcf7_admin_enqueue_styles() { global $plugin_page; if (!isset($plugin_page) || 'wpcf7' != $plugin_page) { return; } wp_enqueue_style('thickbox'); wp_enqueue_style('contact-form-7-admin', wpcf7_plugin_url('admin/styles.css'), array(), WPCF7_VERSION, 'all'); if (wpcf7_is_rtl()) { wp_enqueue_style('contact-form-7-admin-rtl', wpcf7_plugin_url('admin/styles-rtl.css'), array(), WPCF7_VERSION, 'all'); } }
public function form_html($args = '') { $args = wp_parse_args($args, array('html_id' => '', 'html_name' => '', 'html_class' => '', 'output' => 'form')); if ('raw_form' == $args['output']) { return '<pre class="wpcf7-raw-form"><code>' . esc_html($this->prop('form')) . '</code></pre>'; } $this->unit_tag = self::get_unit_tag($this->id); $html = sprintf('<div %s>', wpcf7_format_atts(array('role' => 'form', 'class' => 'wpcf7', 'id' => $this->unit_tag, get_option('html_type') == 'text/html' ? 'lang' : 'xml:lang' => str_replace('_', '-', $this->locale), 'dir' => wpcf7_is_rtl($this->locale) ? 'rtl' : 'ltr'))) . "\n"; $html .= $this->screen_reader_response() . "\n"; $url = wpcf7_get_request_uri(); if ($frag = strstr($url, '#')) { $url = substr($url, 0, -strlen($frag)); } $url .= '#' . $this->unit_tag; $url = apply_filters('wpcf7_form_action_url', $url); $id_attr = apply_filters('wpcf7_form_id_attr', preg_replace('/[^A-Za-z0-9:._-]/', '', $args['html_id'])); $name_attr = apply_filters('wpcf7_form_name_attr', preg_replace('/[^A-Za-z0-9:._-]/', '', $args['html_name'])); $class = 'wpcf7-form'; if ($this->is_posted()) { $submission = WPCF7_Submission::get_instance(); if ($submission->is('validation_failed')) { $class .= ' invalid'; } elseif ($submission->is('spam')) { $class .= ' spam'; } elseif ($submission->is('mail_sent')) { $class .= ' sent'; } elseif ($submission->is('mail_failed')) { $class .= ' failed'; } } if ($args['html_class']) { $class .= ' ' . $args['html_class']; } if ($this->in_demo_mode()) { $class .= ' demo'; } $class = explode(' ', $class); $class = array_map('sanitize_html_class', $class); $class = array_filter($class); $class = array_unique($class); $class = implode(' ', $class); $class = apply_filters('wpcf7_form_class_attr', $class); $enctype = apply_filters('wpcf7_form_enctype', ''); $novalidate = apply_filters('wpcf7_form_novalidate', wpcf7_support_html5()); $atts = array('action' => esc_url($url), 'method' => 'post', 'class' => $class, 'enctype' => wpcf7_enctype_value($enctype), 'novalidate' => $novalidate ? 'novalidate' : ''); if ('' !== $id_attr) { $atts['id'] = $id_attr; } if ('' !== $name_attr) { $atts['name'] = $name_attr; } $atts = wpcf7_format_atts($atts); $html .= sprintf('<form %s>', $atts) . "\n"; $html .= $this->form_hidden_fields(); $html .= $this->form_elements(); if (!$this->responses_count) { $html .= $this->form_response_output(); } $html .= '</form>'; $html .= '</div>'; return $html; }
function wpcf7_admin_enqueue_scripts($hook_suffix) { if (false === strpos($hook_suffix, 'wpcf7')) { return; } wp_enqueue_style('contact-form-7-admin', wpcf7_plugin_url('admin/css/styles.css'), array('thickbox'), WPCF7_VERSION, 'all'); if (wpcf7_is_rtl()) { wp_enqueue_style('contact-form-7-admin-rtl', wpcf7_plugin_url('admin/css/styles-rtl.css'), array(), WPCF7_VERSION, 'all'); } wp_enqueue_script('wpcf7-admin-taggenerator', wpcf7_plugin_url('admin/js/taggenerator.js'), array('jquery'), WPCF7_VERSION, true); wp_enqueue_script('wpcf7-admin', wpcf7_plugin_url('admin/js/scripts.js'), array('jquery', 'thickbox', 'postbox', 'wpcf7-admin-taggenerator'), WPCF7_VERSION, true); wp_localize_script('wpcf7-admin', '_wpcf7', array('generateTag' => __('Generate Tag', 'wpcf7'), 'pluginUrl' => wpcf7_plugin_url(), 'tagGenerators' => wpcf7_tag_generators())); }
function wpcf7_admin_enqueue_scripts($hook_suffix) { if (false === strpos($hook_suffix, 'wpcf7')) { return; } wp_enqueue_style('contact-form-7-admin', wpcf7_plugin_url('admin/css/styles.css'), array(), WPCF7_VERSION, 'all'); if (wpcf7_is_rtl()) { wp_enqueue_style('contact-form-7-admin-rtl', wpcf7_plugin_url('admin/css/styles-rtl.css'), array(), WPCF7_VERSION, 'all'); } wp_enqueue_script('wpcf7-admin', wpcf7_plugin_url('admin/js/scripts.js'), array('jquery', 'jquery-ui-tabs'), WPCF7_VERSION, true); wp_localize_script('wpcf7-admin', '_wpcf7', array('pluginUrl' => wpcf7_plugin_url(), 'saveAlert' => __("The changes you made will be lost if you navigate away from this page.", 'contact-form-7'), 'activeTab' => isset($_GET['active-tab']) ? (int) $_GET['active-tab'] : 0)); add_thickbox(); wp_enqueue_script('wpcf7-admin-taggenerator', wpcf7_plugin_url('admin/js/tag-generator.js'), array('jquery', 'thickbox', 'wpcf7-admin'), WPCF7_VERSION, true); }
function wpcf7_enqueue_styles() { wp_enqueue_style('contact-form-7', wpcf7_plugin_url('styles.css'), array(), WPCF7_VERSION, 'all'); if (wpcf7_is_rtl()) { wp_enqueue_style('contact-form-7-rtl', wpcf7_plugin_url('styles-rtl.css'), array(), WPCF7_VERSION, 'all'); } do_action('wpcf7_enqueue_styles'); }
function wpcf7_admin_enqueue_scripts($hook_suffix) { if (false === strpos($hook_suffix, 'wpcf7')) { return; } wp_enqueue_style('contact-form-7-admin', wpcf7_plugin_url('admin/css/styles.css'), array(), WPCF7_VERSION, 'all'); if (wpcf7_is_rtl()) { wp_enqueue_style('contact-form-7-admin-rtl', wpcf7_plugin_url('admin/css/styles-rtl.css'), array(), WPCF7_VERSION, 'all'); } wp_enqueue_script('wpcf7-admin', wpcf7_plugin_url('admin/js/scripts.js'), array('jquery', 'jquery-ui-tabs'), WPCF7_VERSION, true); $args = array('pluginUrl' => wpcf7_plugin_url(), 'saveAlert' => __("The changes you made will be lost if you navigate away from this page.", 'contact-form-7'), 'activeTab' => isset($_GET['active-tab']) ? (int) $_GET['active-tab'] : 0, 'howToCorrectLink' => __("How to correct this?", 'contact-form-7'), 'configErrors' => array()); if (($post = wpcf7_get_current_contact_form()) && current_user_can('wpcf7_edit_contact_form', $post->id()) && wpcf7_validate_configuration()) { $config_validator = new WPCF7_ConfigValidator($post); $error_messages = $config_validator->collect_error_messages(); foreach ($error_messages as $section => $errors) { $args['configErrors'][$section] = array(); foreach ($errors as $error) { $args['configErrors'][$section][] = array('message' => esc_html($error['message']), 'link' => esc_url($error['link'])); } } } wp_localize_script('wpcf7-admin', '_wpcf7', $args); add_thickbox(); wp_enqueue_script('wpcf7-admin-taggenerator', wpcf7_plugin_url('admin/js/tag-generator.js'), array('jquery', 'thickbox', 'wpcf7-admin'), WPCF7_VERSION, true); }
function wpcf7_enqueue_styles() { if (!wpcf7_load_css()) { return; } wp_enqueue_style('contact-form-7', wpcf7_plugin_url('includes/css/styles.css'), array(), WPCF7_VERSION, 'all'); if (wpcf7_is_rtl()) { wp_enqueue_style('contact-form-7-rtl', wpcf7_plugin_url('includes/css/styles-rtl.css'), array(), WPCF7_VERSION, 'all'); } do_action('wpcf7_enqueue_styles'); }