/wp-content/plugins/contact-form-7/includes/shortcodes.php

https://bitbucket.org/devbctph/futura_wp · PHP · 101 lines · 68 code · 28 blank · 5 comment · 2 complexity · dab6dda50b2c04ab97529faa57fd920d MD5 · raw file

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