block-editor
5 years ago
css
5 years ago
js
5 years ago
capabilities.php
7 years ago
config-validator.php
5 years ago
contact-form-functions.php
5 years ago
contact-form-template.php
5 years ago
contact-form.php
5 years ago
controller.php
7 years ago
form-tag.php
5 years ago
form-tags-manager.php
6 years ago
formatting.php
5 years ago
functions.php
5 years ago
integration.php
7 years ago
l10n.php
5 years ago
mail.php
5 years ago
pipe.php
5 years ago
rest-api.php
5 years ago
shortcodes.php
9 years ago
special-mail-tags.php
5 years ago
submission.php
5 years ago
upgrade.php
7 years ago
validation.php
7 years ago
shortcodes.php
102 lines
| 1 | <?php |
| 2 | /** |
| 3 | * All the functions and classes in this file are deprecated. |
| 4 | * You shouldn't use them. The functions and classes will be |
| 5 | * removed in a later version. |
| 6 | */ |
| 7 | |
| 8 | function wpcf7_add_shortcode( $tag, $func, $has_name = false ) { |
| 9 | wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_add_form_tag' ); |
| 10 | |
| 11 | return wpcf7_add_form_tag( $tag, $func, $has_name ); |
| 12 | } |
| 13 | |
| 14 | function wpcf7_remove_shortcode( $tag ) { |
| 15 | wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_remove_form_tag' ); |
| 16 | |
| 17 | return wpcf7_remove_form_tag( $tag ); |
| 18 | } |
| 19 | |
| 20 | function wpcf7_do_shortcode( $content ) { |
| 21 | wpcf7_deprecated_function( __FUNCTION__, '4.6', |
| 22 | 'wpcf7_replace_all_form_tags' ); |
| 23 | |
| 24 | return wpcf7_replace_all_form_tags( $content ); |
| 25 | } |
| 26 | |
| 27 | function wpcf7_scan_shortcode( $cond = null ) { |
| 28 | wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_scan_form_tags' ); |
| 29 | |
| 30 | return wpcf7_scan_form_tags( $cond ); |
| 31 | } |
| 32 | |
| 33 | class WPCF7_ShortcodeManager { |
| 34 | |
| 35 | private static $form_tags_manager; |
| 36 | |
| 37 | private function __construct() {} |
| 38 | |
| 39 | public static function get_instance() { |
| 40 | wpcf7_deprecated_function( __METHOD__, '4.6', |
| 41 | 'WPCF7_FormTagsManager::get_instance' ); |
| 42 | |
| 43 | self::$form_tags_manager = WPCF7_FormTagsManager::get_instance(); |
| 44 | return new self; |
| 45 | } |
| 46 | |
| 47 | public function get_scanned_tags() { |
| 48 | wpcf7_deprecated_function( __METHOD__, '4.6', |
| 49 | 'WPCF7_FormTagsManager::get_scanned_tags' ); |
| 50 | |
| 51 | return self::$form_tags_manager->get_scanned_tags(); |
| 52 | } |
| 53 | |
| 54 | public function add_shortcode( $tag, $func, $has_name = false ) { |
| 55 | wpcf7_deprecated_function( __METHOD__, '4.6', |
| 56 | 'WPCF7_FormTagsManager::add' ); |
| 57 | |
| 58 | return self::$form_tags_manager->add( $tag, $func, $has_name ); |
| 59 | } |
| 60 | |
| 61 | public function remove_shortcode( $tag ) { |
| 62 | wpcf7_deprecated_function( __METHOD__, '4.6', |
| 63 | 'WPCF7_FormTagsManager::remove' ); |
| 64 | |
| 65 | return self::$form_tags_manager->remove( $tag ); |
| 66 | } |
| 67 | |
| 68 | public function normalize_shortcode( $content ) { |
| 69 | wpcf7_deprecated_function( __METHOD__, '4.6', |
| 70 | 'WPCF7_FormTagsManager::normalize' ); |
| 71 | |
| 72 | return self::$form_tags_manager->normalize( $content ); |
| 73 | } |
| 74 | |
| 75 | public function do_shortcode( $content, $exec = true ) { |
| 76 | wpcf7_deprecated_function( __METHOD__, '4.6', |
| 77 | 'WPCF7_FormTagsManager::replace_all' ); |
| 78 | |
| 79 | if ( $exec ) { |
| 80 | return self::$form_tags_manager->replace_all( $content ); |
| 81 | } else { |
| 82 | return self::$form_tags_manager->scan( $content ); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | public function scan_shortcode( $content ) { |
| 87 | wpcf7_deprecated_function( __METHOD__, '4.6', |
| 88 | 'WPCF7_FormTagsManager::scan' ); |
| 89 | |
| 90 | return self::$form_tags_manager->scan( $content ); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | class WPCF7_Shortcode extends WPCF7_FormTag { |
| 95 | |
| 96 | public function __construct( $tag ) { |
| 97 | wpcf7_deprecated_function( 'WPCF7_Shortcode', '4.6', 'WPCF7_FormTag' ); |
| 98 | |
| 99 | parent::__construct( $tag ); |
| 100 | } |
| 101 | } |
| 102 |