PageRenderTime 28ms CodeModel.GetById 11ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 1ms

/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
  8function 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
 14function 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
 20function 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
 27function 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
 33class 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
 94class 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}