/includes/shortcodes.php

  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. function wpcf7_remove_shortcode( $tag ) { 
  14. wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_remove_form_tag' ); 
  15.  
  16. return wpcf7_remove_form_tag( $tag ); 
  17.  
  18. function wpcf7_do_shortcode( $content ) { 
  19. wpcf7_deprecated_function( __FUNCTION__, '4.6',  
  20. 'wpcf7_replace_all_form_tags' ); 
  21.  
  22. return wpcf7_replace_all_form_tags( $content ); 
  23.  
  24. function wpcf7_scan_shortcode( $cond = null ) { 
  25. wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_scan_form_tags' ); 
  26.  
  27. return wpcf7_scan_form_tags( $cond ); 
  28.  
  29. class WPCF7_ShortcodeManager { 
  30.  
  31. private static $form_tags_manager; 
  32.  
  33. private function __construct() {} 
  34.  
  35. public static function get_instance() { 
  36. wpcf7_deprecated_function( __METHOD__, '4.6',  
  37. 'WPCF7_FormTagsManager::get_instance' ); 
  38.  
  39. self::$form_tags_manager = WPCF7_FormTagsManager::get_instance(); 
  40. return new self; 
  41.  
  42. public function get_scanned_tags() { 
  43. wpcf7_deprecated_function( __METHOD__, '4.6',  
  44. 'WPCF7_FormTagsManager::get_scanned_tags' ); 
  45.  
  46. return self::$form_tags_manager->get_scanned_tags(); 
  47.  
  48. public function add_shortcode( $tag, $func, $has_name = false ) { 
  49. wpcf7_deprecated_function( __METHOD__, '4.6',  
  50. 'WPCF7_FormTagsManager::add' ); 
  51.  
  52. return self::$form_tags_manager->add( $tag, $func, $has_name ); 
  53.  
  54. public function remove_shortcode( $tag ) { 
  55. wpcf7_deprecated_function( __METHOD__, '4.6',  
  56. 'WPCF7_FormTagsManager::remove' ); 
  57.  
  58. return self::$form_tags_manager->remove( $tag ); 
  59.  
  60. public function normalize_shortcode( $content ) { 
  61. wpcf7_deprecated_function( __METHOD__, '4.6',  
  62. 'WPCF7_FormTagsManager::normalize' ); 
  63.  
  64. return self::$form_tags_manager->normalize( $content ); 
  65.  
  66. public function do_shortcode( $content, $exec = true ) { 
  67. wpcf7_deprecated_function( __METHOD__, '4.6',  
  68. 'WPCF7_FormTagsManager::replace_all' ); 
  69.  
  70. if ( $exec ) { 
  71. return self::$form_tags_manager->replace_all( $content ); 
  72. } else { 
  73. return self::$form_tags_manager->scan( $content ); 
  74.  
  75. public function scan_shortcode( $content ) { 
  76. wpcf7_deprecated_function( __METHOD__, '4.6',  
  77. 'WPCF7_FormTagsManager::scan' ); 
  78.  
  79. return self::$form_tags_manager->scan( $content ); 
  80.  
  81. class WPCF7_Shortcode extends WPCF7_FormTag { 
  82.  
  83. public function __construct( $tag ) { 
  84. wpcf7_deprecated_function( 'WPCF7_Shortcode', '4.6', 'WPCF7_FormTag' ); 
  85.  
  86. parent::__construct( $tag ); 
.