public function init() { if (function_exists('wpcf7_add_shortcode')) { /* Shortcode handler */ wpcf7_add_shortcode('simplehidden', array($this, 'simple_shortcode_handler'), true); wpcf7_add_shortcode('dynamichidden2', array($this, 'dynamic_shortcode_handler'), true); } add_filter('wpcf7_validate_simplehidden', array($this, 'validation_filter'), 10, 2); add_filter('wpcf7_validate_dynamichidden2', array($this, 'validation_filter'), 10, 2); add_action('admin_init', array($this, 'add_tg_generator'), 25); add_filter('test_hidden_field_filter', array($this, 'test_filter'), 10, 2); }
function cf7bs_recaptcha_add_shortcode_recaptcha() { $recaptcha = WPCF7_RECAPTCHA::get_instance(); if ($recaptcha->is_active()) { wpcf7_add_shortcode('recaptcha', 'cf7bs_recaptcha_shortcode_handler'); } }
function contact_form_7_hidden_fields() { global $pagenow; if (function_exists('wpcf7_add_shortcode')) { wpcf7_add_shortcode('hidden', 'wpcf7_hidden_shortcode_handler', true); wpcf7_add_shortcode('hidden*', 'wpcf7_hidden_shortcode_handler', true); } else { if ($pagenow != 'plugins.php') { return; } add_action('admin_notices', 'cfhiddenfieldserror'); add_action('admin_enqueue_scripts', 'contact_form_7_hidden_fields_scripts'); function cfhiddenfieldserror() { $out = '<div class="error" id="messages"><p>'; if (file_exists(WP_PLUGIN_DIR . '/contact-form-7/wp-contact-form-7.php')) { $out .= 'The Contact Form 7 is installed, but <strong>you must activate Contact Form 7</strong> below for the Hidden Fields Module to work.'; } else { $out .= 'The Contact Form 7 plugin must be installed for the Hidden Fields Module to work. <a href="' . admin_url('plugin-install.php?tab=plugin-information&plugin=contact-form-7&from=plugins&TB_iframe=true&width=600&height=550') . '" class="thickbox" title="Contact Form 7">Install Now.</a>'; } $out .= '</p></div>'; echo $out; } } }
function wpcf7_add_shortcode_icon_btn() { if (!function_exists('wpcf7_add_shortcode')) { return; } wpcf7_add_shortcode('button', 'wpcf7_icon_btn_shortcode_handler'); }
function add_shortcode_dropdown_paket() { wpcf7_add_shortcode(['pilih_paket', 'pilih_paket*'], 'dropDownPaket', true); // see helpers/helpers.php for called function wpcf7_add_shortcode(['tgl_keberangkatan', 'tgl_keberangkatan*'], 'dropDownDateDeparture', true); // see helpers/helpers.php for called function }
/** * Registers the CF7 shortcode * * @return boolean */ public function add_shortcode() { if (!function_exists('wpcf7_add_shortcode')) { return false; } wpcf7_add_shortcode('mc4wp_checkbox', array($this, 'get_checkbox')); return true; }
/** * Registers the CF7 shortcode * * @return boolean */ public function init() { if (!function_exists('wpcf7_add_shortcode')) { return false; } wpcf7_add_shortcode('yikes_mailchimp_checkbox', array($this, 'yikes_get_checkbox')); return true; }
function hw_wpcf7_create_fields() { wpcf7_add_shortcode(array('province', 'province*'), '_hw_wcpf7_province_shortcode_ddlQuanHuyen', true); //register country field wpcf7_add_shortcode(array('nationality', 'nationality*'), '_hw_wcpf7_country_field_shortcode', true); //wpcf7_add_shortcode(('tinhthanh'), '_shortcode_ddlTinhthanh',true); //wpcf7_add_shortcode(('tinhthanh*'), '_shortcode_ddlTinhthanh',true); }
/** * Check that WPCF is installed and add in hooks. * * @return bool */ function sendywpcf_init() { add_action('wpcf7_mail_sent', 'subscribe_from_cf7'); if (!function_exists('wpcf7_add_shortcode')) { return false; } wpcf7_add_shortcode('sendywpcf', 'get_list_id'); return true; }
public function init() { if (function_exists('wpcf7_add_shortcode')) { /* Shortcode handler */ wpcf7_add_shortcode('dynamicselect', array($this, 'shortcode_handler'), true); wpcf7_add_shortcode('dynamicselect*', array($this, 'shortcode_handler'), true); } add_filter('wpcf7_validate_dynamicselect', array($this, 'validation_filter'), 10, 2); add_filter('wpcf7_validate_dynamicselect*', array($this, 'validation_filter'), 10, 2); add_action('admin_init', array($this, 'add_tg_generator'), 25); }
/** ** A base module for [dynamictext], [dynamictext*] **/ function wpcf7_dynamictext_init() { if (function_exists('wpcf7_add_shortcode')) { /* Shortcode handler */ wpcf7_add_shortcode('dynamictext', 'wpcf7_dynamictext_shortcode_handler', true); wpcf7_add_shortcode('dynamictext*', 'wpcf7_dynamictext_shortcode_handler', true); wpcf7_add_shortcode('dynamichidden', 'wpcf7_dynamichidden_shortcode_handler', true); } add_filter('wpcf7_validate_dynamictext', 'wpcf7_dynamictext_validation_filter', 10, 2); add_filter('wpcf7_validate_dynamictext*', 'wpcf7_dynamictext_validation_filter', 10, 2); add_action('admin_init', 'wpcf7_add_tag_generator_dynamictext', 15); add_action('admin_init', 'wpcf7_add_tag_generator_dynamichidden', 16); }
function contact_form_7_confirm_email() { global $pagenow; if (function_exists('wpcf7_add_shortcode')) { wpcf7_add_shortcode(array('confirm_email', 'confirm_email*'), 'wpcf7_confirm_email_shortcode_handler', true); add_filter('wpcf7_validate_confirm_email', 'wpcf7_confirm_email_validation_filter', 10, 2); add_filter('wpcf7_validate_confirm_email*', 'wpcf7_confirm_email_validation_filter', 10, 2); add_action('admin_init', 'wpcf7_add_tag_generator_confirm_email', 30); } else { if ($pagenow != 'plugins.php') { return; } add_action('admin_notices', 'cfconfirm_emailfieldserror'); wp_enqueue_script('thickbox'); function cfconfirm_emailfieldserror() { $out = '<div class="error" id="messages"><p>'; $out .= 'The Contact Form 7 plugin must be installed and activated for the confirm_email Validation for Contact Form 7 to work. <a href="' . admin_url('plugin-install.php?tab=plugin-information&plugin=contact-form-7&from=plugins&TB_iframe=true&width=600&height=550') . '" class="thickbox" title="Contact Form 7">Install Now.</a>'; $out .= '</p></div>'; echo $out; } } }
function wpcf7_add_shortcode_file() { wpcf7_add_shortcode(array('file', 'file*'), 'wpcf7_file_shortcode_handler', true); }
function wpcf7_add_shortcode_mathcaptcha() { wpcf7_add_shortcode('mathcaptcha', 'wpcf7_mathcaptcha_shortcode_handler', true); }
public function register_shortcode($shortcode) { wpcf7_add_shortcode($shortcode, array($this, 'shortcode_process'), true); }
<?php /** ** Note: This ICL module is obsolete and no longer functioning on this version. ** There is a simpler way for creating contact forms of other languages. **/ /* Shortcode handler */ wpcf7_add_shortcode('icl', 'icl_wpcf7_shortcode_handler', true); function icl_wpcf7_shortcode_handler($tag) { if (!is_array($tag)) { return ''; } $name = $tag['name']; $values = (array) $tag['values']; $content = $tag['content']; // Just return the content. $content = trim($content); if (!empty($content)) { return $content; } $value = trim($values[0]); if (!empty($value)) { return $value; } return ''; } /* Message dispaly filter */ add_filter('wpcf7_display_message', 'icl_wpcf7_display_message_filter'); function icl_wpcf7_display_message_filter($message) {
function wpcf7_add_shortcode_robottrap() { wpcf7_add_shortcode(array('robottrap'), 'wpcf7_robottrap_shortcode_handler', true); }
function wpcf7_add_shortcode_number() { wpcf7_add_shortcode(array('number', 'number*', 'range', 'range*'), 'wpcf7_number_shortcode_handler', true); }
function cf7bs_add_shortcode_select() { wpcf7_add_shortcode(array('select', 'select*'), 'cf7bs_select_shortcode_handler', true); }
<?php /** ** A base module for [text], [text*], [email], and [email*] **/ /* Shortcode handler */ wpcf7_add_shortcode('text', 'wpcf7_text_shortcode_handler', true); wpcf7_add_shortcode('text*', 'wpcf7_text_shortcode_handler', true); wpcf7_add_shortcode('email', 'wpcf7_text_shortcode_handler', true); wpcf7_add_shortcode('email*', 'wpcf7_text_shortcode_handler', true); function wpcf7_text_shortcode_handler($tag) { if (!is_array($tag)) { return ''; } $type = $tag['type']; $name = $tag['name']; $options = (array) $tag['options']; $values = (array) $tag['values']; if (empty($name)) { return ''; } $validation_error = wpcf7_get_validation_error($name); $atts = $id_att = $size_att = $maxlength_att = ''; $tabindex_att = $title_att = ''; $class_att = wpcf7_form_controls_class($type, 'wpcf7-text'); if ('email' == $type || 'email*' == $type) { $class_att .= ' wpcf7-validates-as-email'; } if ($validation_error) { $class_att .= ' wpcf7-not-valid';
function wpcf7_add_shortcode_captcha() { wpcf7_add_shortcode(array('captchac', 'captchar'), 'wpcf7_captcha_shortcode_handler', true); }
function wpcf7_add_shortcode_acceptance() { wpcf7_add_shortcode('acceptance', 'wpcf7_acceptance_shortcode_handler', true); }
<?php /** ** A base module for [file] and [file*] **/ /* Shortcode handler */ wpcf7_add_shortcode('file', 'wpcf7_file_shortcode_handler', true); wpcf7_add_shortcode('file*', 'wpcf7_file_shortcode_handler', true); function wpcf7_file_shortcode_handler($tag) { global $wpcf7_contact_form; if (!is_array($tag)) { return ''; } $type = $tag['type']; $name = $tag['name']; $options = (array) $tag['options']; $values = (array) $tag['values']; if (empty($name)) { return ''; } $atts = ''; $id_att = ''; $class_att = ''; if ('file*' == $type) { $class_att .= ' wpcf7-validates-as-required'; } foreach ($options as $option) { if (preg_match('%^id:([-0-9a-zA-Z_]+)$%', $option, $matches)) { $id_att = $matches[1]; } elseif (preg_match('%^class:([-0-9a-zA-Z_]+)$%', $option, $matches)) {
return ''; } $options = (array) $tag['options']; $values = (array) $tag['values']; $atts = ''; $id_att = ''; $class_att = ''; foreach ($options as $option) { if (preg_match('%^id:([-0-9a-zA-Z_]+)$%', $option, $matches)) { $id_att = $matches[1]; } elseif (preg_match('%^class:([-0-9a-zA-Z_]+)$%', $option, $matches)) { $class_att .= ' ' . $matches[1]; } } if ($id_att) { $atts .= ' id="' . trim($id_att) . '"'; } if ($class_att) { $atts .= ' class="' . trim($class_att) . '"'; } $value = $values[0]; if (empty($value)) { $value = __('Send', 'wpcf7'); } $ajax_loader_image_url = wpcf7_plugin_url('images/ajax-loader.gif'); $html = '<input type="submit" value="' . esc_attr($value) . '"' . $atts . ' />'; $html .= ' <img class="ajax-loader" style="visibility: hidden;" alt="ajax loader" src="' . $ajax_loader_image_url . '" />'; return $html; } wpcf7_add_shortcode('submit', 'wpcf7_submit_shortcode_handler');
function cf7bs_add_shortcode_quiz() { wpcf7_add_shortcode('quiz', 'cf7bs_quiz_shortcode_handler', true); }
function wpcf7_add_shortcode_text() { wpcf7_add_shortcode(array('text', 'text*', 'email', 'email*', 'url', 'url*', 'tel', 'tel*'), 'wpcf7_text_shortcode_handler', true); }
public function add_cf7_shortcode() { if (function_exists("wpcf7_add_shortcode")) { wpcf7_add_shortcode('mc4wp_checkbox', array($this, 'get_checkbox')); } }
function wpcf7_add_shortcode_textarea() { wpcf7_add_shortcode(array('textarea', 'textarea*'), 'wpcf7_textarea_shortcode_handler', true); }
<?php /** ** A base module for [acceptance] **/ /* Shortcode handler */ wpcf7_add_shortcode('acceptance', 'wpcf7_acceptance_shortcode_handler', true); function wpcf7_acceptance_shortcode_handler($tag) { global $wpcf7_contact_form; if (!is_array($tag)) { return ''; } $type = $tag['type']; $name = $tag['name']; $options = (array) $tag['options']; $values = (array) $tag['values']; if (empty($name)) { return ''; } $atts = ''; $id_att = ''; $class_att = ''; $tabindex_att = ''; $class_att .= ' wpcf7-acceptance'; foreach ($options as $option) { if (preg_match('%^id:([-0-9a-zA-Z_]+)$%', $option, $matches)) { $id_att = $matches[1]; } elseif (preg_match('%^class:([-0-9a-zA-Z_]+)$%', $option, $matches)) { $class_att .= ' ' . $matches[1]; } elseif ('invert' == $option) {
public function on_init() { if (function_exists("wpcf7_add_shortcode")) { add_action('wpcf7_mail_sent', array($this, 'subscribe_from_cf7')); wpcf7_add_shortcode('mc4wp_checkbox', array($this, 'get_checkbox')); } }