diff --git a/modules/acceptance.php b/modules/acceptance.php index 3011b8c..eeb5eb2 100755 --- a/modules/acceptance.php +++ b/modules/acceptance.php @@ -11,11 +11,18 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_acceptance' ); function cf7bs_add_shortcode_acceptance() { - wpcf7_add_shortcode( 'acceptance', 'cf7bs_acceptance_shortcode_handler', true ); + $tags = array( + 'acceptance' + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_acceptance_shortcode_handler', true ); } function cf7bs_acceptance_shortcode_handler( $tag ) { - $tag = new WPCF7_Shortcode( $tag ); + $tag = new WPCF7_FormTag( $tag ); if ( empty( $tag->name ) ) { return ''; diff --git a/modules/checkbox.php b/modules/checkbox.php index 9bc61a0..c37824a 100755 --- a/modules/checkbox.php +++ b/modules/checkbox.php @@ -11,15 +11,20 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_checkbox' ); function cf7bs_add_shortcode_checkbox() { - wpcf7_add_shortcode( array( + $tags = array( 'checkbox', 'checkbox*', 'radio', - ), 'cf7bs_checkbox_shortcode_handler', true ); + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_checkbox_shortcode_handler', true ); } function cf7bs_checkbox_shortcode_handler( $tag ) { - $tag = new WPCF7_Shortcode( $tag ); + $tag = new WPCF7_FormTag( $tag ); if ( empty( $tag->name ) ) { return ''; diff --git a/modules/count.php b/modules/count.php index e9676a1..e40ef19 100755 --- a/modules/count.php +++ b/modules/count.php @@ -11,11 +11,18 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_count' ); function cf7bs_add_shortcode_count() { - wpcf7_add_shortcode( 'count', 'cf7bs_count_shortcode_handler', true ); + $tags = array( + 'count' + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_count_shortcode_handler', true ); } function cf7bs_count_shortcode_handler( $tag ) { - $tag_obj = new WPCF7_Shortcode( $tag ); + $tag_obj = new WPCF7_FormTag( $tag ); if ( empty( $tag_obj->name ) ) { return ''; diff --git a/modules/date.php b/modules/date.php index 7b4d3e5..211e5dd 100755 --- a/modules/date.php +++ b/modules/date.php @@ -11,14 +11,19 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_date' ); function cf7bs_add_shortcode_date() { - wpcf7_add_shortcode( array( + $tags = array( 'date', 'date*', - ), 'cf7bs_date_shortcode_handler', true ); + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_date_shortcode_handler', true ); } function cf7bs_date_shortcode_handler( $tag ) { - $tag = new WPCF7_Shortcode( $tag ); + $tag = new WPCF7_FormTag( $tag ); if ( empty( $tag->name ) ) { return ''; diff --git a/modules/file.php b/modules/file.php index 97b0d90..81b59dc 100755 --- a/modules/file.php +++ b/modules/file.php @@ -11,14 +11,19 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_file' ); function cf7bs_add_shortcode_file() { - wpcf7_add_shortcode( array( + $tags = array( 'file', 'file*', - ), 'cf7bs_file_shortcode_handler', true ); + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_file_shortcode_handler', true ); } function cf7bs_file_shortcode_handler( $tag ) { - $tag = new WPCF7_Shortcode( $tag ); + $tag = new WPCF7_FormTag( $tag ); if ( empty( $tag->name ) ) { return ''; diff --git a/modules/number.php b/modules/number.php index 9491ae7..ec99b3d 100755 --- a/modules/number.php +++ b/modules/number.php @@ -11,16 +11,21 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_number' ); function cf7bs_add_shortcode_number() { - wpcf7_add_shortcode( array( + $tags = array( 'number', 'number*', 'range', 'range*', - ), 'cf7bs_number_shortcode_handler', true ); + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_number_shortcode_handler', true ); } function cf7bs_number_shortcode_handler( $tag ) { - $tag = new WPCF7_Shortcode( $tag ); + $tag = new WPCF7_FormTag( $tag ); if ( empty( $tag->name ) ) { return ''; diff --git a/modules/quiz.php b/modules/quiz.php index 4d1e355..f73ea1c 100755 --- a/modules/quiz.php +++ b/modules/quiz.php @@ -11,11 +11,18 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_quiz' ); function cf7bs_add_shortcode_quiz() { - wpcf7_add_shortcode( 'quiz', 'cf7bs_quiz_shortcode_handler', true ); + $tags = array( + 'quiz' + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_quiz_shortcode_handler', true ); } function cf7bs_quiz_shortcode_handler( $tag ) { - $tag = new WPCF7_Shortcode( $tag ); + $tag = new WPCF7_FormTag( $tag ); if ( empty( $tag->name ) ) { return ''; diff --git a/modules/really-simple-captcha.php b/modules/really-simple-captcha.php index 9a41e40..2f74817 100755 --- a/modules/really-simple-captcha.php +++ b/modules/really-simple-captcha.php @@ -11,14 +11,19 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_captcha' ); function cf7bs_add_shortcode_captcha() { - wpcf7_add_shortcode( array( + $tags = array( 'captchac', 'captchar', - ), 'cf7bs_captcha_shortcode_handler', true ); + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_captcha_shortcode_handler', true ); } function cf7bs_captcha_shortcode_handler( $tag ) { - $tag_obj = new WPCF7_Shortcode( $tag ); + $tag_obj = new WPCF7_FormTag( $tag ); if ( 'captchac' == $tag_obj->type && ! class_exists( 'ReallySimpleCaptcha' ) ) { return '' . __( 'To use CAPTCHA, you need Really Simple CAPTCHA plugin installed.', 'bootstrap-for-contact-form-7' ) . ''; @@ -149,7 +154,7 @@ function cf7bs_captcha_ajax_refill( $items ) { return $items; } - $fes = wpcf7_scan_shortcode( array( 'type' => 'captchar' ) ); + $fes = wpcf7_scan_form_tags( array( 'type' => 'captchar' ) ); if ( empty( $fes ) ) { return $items; diff --git a/modules/recaptcha.php b/modules/recaptcha.php index c524f86..f17cb6e 100755 --- a/modules/recaptcha.php +++ b/modules/recaptcha.php @@ -15,12 +15,19 @@ function cf7bs_recaptcha_add_shortcode_recaptcha() { $recaptcha = WPCF7_RECAPTCHA::get_instance(); if ( $recaptcha->is_active() ) { - wpcf7_add_shortcode( 'recaptcha', 'cf7bs_recaptcha_shortcode_handler' ); + $tags = array( + 'recaptcha' + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_recaptcha_shortcode_handler' ); } } function cf7bs_recaptcha_shortcode_handler( $tag ) { - $tag_obj = new WPCF7_Shortcode( $tag ); + $tag_obj = new WPCF7_FormTag( $tag ); $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array( 'name' => wpcf7_recaptcha_shortcode_handler( $tag ), diff --git a/modules/select.php b/modules/select.php index 24d1298..82efb19 100755 --- a/modules/select.php +++ b/modules/select.php @@ -11,14 +11,19 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_select' ); function cf7bs_add_shortcode_select() { - wpcf7_add_shortcode( array( + $tags = array( 'select', 'select*', - ), 'cf7bs_select_shortcode_handler', true ); + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_select_shortcode_handler', true ); } function cf7bs_select_shortcode_handler( $tag ) { - $tag = new WPCF7_Shortcode( $tag ); + $tag = new WPCF7_FormTag( $tag ); if ( empty( $tag->name ) ) { return ''; diff --git a/modules/submit.php b/modules/submit.php index 66e99f4..f3645dc 100755 --- a/modules/submit.php +++ b/modules/submit.php @@ -11,11 +11,18 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_submit' ); function cf7bs_add_shortcode_submit() { - wpcf7_add_shortcode( 'submit', 'cf7bs_submit_shortcode_handler' ); + $tags = array( + 'submit' + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_submit_shortcode_handler' ); } function cf7bs_submit_shortcode_handler( $tag ) { - $tag = new WPCF7_Shortcode( $tag ); + $tag = new WPCF7_FormTag( $tag ); $class = wpcf7_form_controls_class( $tag->type ); diff --git a/modules/text.php b/modules/text.php index fd7508f..6afac55 100755 --- a/modules/text.php +++ b/modules/text.php @@ -11,7 +11,7 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_text' ); function cf7bs_add_shortcode_text() { - wpcf7_add_shortcode( array( + $tags = array( 'text', 'text*', 'email', @@ -20,11 +20,16 @@ function cf7bs_add_shortcode_text() { 'url*', 'tel', 'tel*', - ), 'cf7bs_text_shortcode_handler', true ); + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_text_shortcode_handler', true ); } function cf7bs_text_shortcode_handler( $tag ) { - $tag_obj = new WPCF7_Shortcode( $tag ); + $tag_obj = new WPCF7_FormTag( $tag ); if ( empty( $tag_obj->name ) ) { return ''; diff --git a/modules/textarea.php b/modules/textarea.php index abd6d74..0e12ada 100755 --- a/modules/textarea.php +++ b/modules/textarea.php @@ -11,14 +11,19 @@ add_action( 'wpcf7_init', 'cf7bs_add_shortcode_textarea' ); function cf7bs_add_shortcode_textarea() { - wpcf7_add_shortcode( array( + $tags = array( 'textarea', 'textarea*', - ), 'cf7bs_textarea_shortcode_handler', true ); + ); + foreach ( $tags as $tag ) { + wpcf7_remove_form_tag( $tag ); + } + + wpcf7_add_form_tag( $tags, 'cf7bs_textarea_shortcode_handler', true ); } function cf7bs_textarea_shortcode_handler( $tag ) { - $tag_obj = new WPCF7_Shortcode( $tag ); + $tag_obj = new WPCF7_FormTag( $tag ); if ( empty( $tag_obj->name ) ) { return '';