GravityView  2.1.1
The best, easiest way to display Gravity Forms entries on your website.
class-oembed.php
Go to the documentation of this file.
1 <?php
2 /**
3  * GravityView oEmbed handling
4  *
5  * @package GravityView
6  * @license GPL2+
7  * @author Katz Web Services, Inc.
8  * @link http://gravityview.co
9  * @copyright Copyright 2014, Katz Web Services, Inc.
10  * @since 1.6
11  */
12 
13 if ( ! defined( 'ABSPATH' ) ) {
14  die;
15 }
16 
17 /**
18  * Register oEmbed handlers for embedding GravityView data and render that data
19  *
20  * @since 1.6
21  */
23  protected $entry_id = NULL;
24 
25  static $instance = NULL;
26 
27  private function __construct() {}
28 
29  /**
30  * @deprecated Use \GV\oEmbed instead.
31  */
32  public function initialize() {
33  gravityview()->log->notice( '\GravityView_oEmbed is deprecated. Use \GV\oEmbed instead.' );
34  }
35 
36  /**
37  * @deprecated Use \GV\oEmbed instead.
38  *
39  * @return GravityView_oEmbed
40  * @since 1.6
41  */
42  static function getInstance() {
43  gravityview()->log->notice( '\GravityView_oEmbed is deprecated. Use \GV\oEmbed instead.' );
44 
45  if( empty( self::$instance ) ) {
46  self::$instance = new self;
47  self::$instance->initialize();
48  }
49 
50  return self::$instance;
51  }
52 
53  /**
54  * Register the oEmbed handler
55  *
56  * @deprecated Use \GV\oEmbed instead.
57  *
58  * @since 1.6
59  */
60  function register_handler() {
61  gravityview()->log->notice( '\GravityView_oEmbed is deprecated. Use \GV\oEmbed instead.' );
62 
63  }
64 
65  /**
66  * Become an oEmbed provider for GravityView.
67  *
68  * @deprecated Use \GV\oEmbed instead.
69  *
70  * @return void
71  */
72  function add_provider() {
73  gravityview()->log->notice( '\GravityView_oEmbed is deprecated. Use \GV\oEmbed instead.' );
74  }
75 
76  /**
77  * Output a response as a provider for an entry oEmbed URL.
78  *
79  * @deprecated Use \GV\oEmbed instead.
80  *
81  * For now we only output the JSON format and don't care about the size (width, height).
82  * Our only current use-case is for it to provide output to the Add Media / From URL box
83  * in WordPress 4.8.
84  *
85  * @since 1.21.5.3
86  *
87  * @return void
88  */
90  gravityview()->log->notice( '\GravityView_oEmbed is deprecated. Use \GV\oEmbed instead.' );
91  }
92 
93  /**
94  * Get the entry id for the current oEmbedded entry
95  *
96  * @since 1.6
97  *
98  * @deprecated Use \GV\oEmbed instead.
99  *
100  * @return int|null
101  */
102  public function get_entry_id() {
103  gravityview()->log->notice( '\GravityView_oEmbed is deprecated. Use \GV\oEmbed instead.' );
104  return $this->entry_id;
105  }
106 
107  /**
108  * @deprecated Use \GV\oEmbed instead.
109  *
110  * @since 1.6
111  * @see GravityView_oEmbed::add_providers() for the regex
112  *
113  * @param array $matches The regex matches from the provided regex when calling wp_embed_register_handler()
114  * @param array $attr Embed attributes.
115  * @param string $url The original URL that was matched by the regex.
116  * @param array $rawattr The original unmodified attributes.
117  * @return string The embed HTML.
118  */
119  public function render_handler( $matches, $attr, $url, $rawattr ) {
120  gravityview()->log->notice( '\GravityView_oEmbed is deprecated. Use \GV\oEmbed instead.' );
121  return '';
122  }
123 
124  /**
125  * Tell get_gravityview() to display a single entry
126  *
127  * REQUIRED FOR THE VIEW TO OUTPUT A SINGLE ENTRY
128  *
129  * @deprecated Use \GV\oEmbed instead.
130  *
131  * @param bool|int $is_single_entry Existing single entry. False, because GV thinks we're in a post or page.
132  *
133  * @return int The current entry ID
134  */
135  public function set_single_entry_id( $is_single_entry = false ) {
136  gravityview()->log->notice( '\GravityView_oEmbed is deprecated. Use \GV\oEmbed instead.' );
137  return $this->entry_id;
138  }
139 }
$url
Definition: post_image.php:25
Register oEmbed handlers for embedding GravityView data and render that data.
register_handler()
Register the oEmbed handler.
gravityview()
Definition: _stubs.php:26
get_entry_id()
Get the entry id for the current oEmbedded entry.
set_single_entry_id( $is_single_entry=false)
Tell get_gravityview() to display a single entry.
add_provider()
Become an oEmbed provider for GravityView.
render_provider_request()
Output a response as a provider for an entry oEmbed URL.
render_handler( $matches, $attr, $url, $rawattr)