PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.9
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.9
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / models / FrmYoutubeFeedApi.php

FrmYoutubeFeedApi.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.9, at classes/models/FrmYoutubeFeedApi.php

49 lines 1003 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 die( 'You are not allowed to call this page directly.' );
5 }
6
7 class FrmYoutubeFeedApi extends FrmFormApi {
8
9 /**
10 * The YouTube API URL.
11 *
12 * @var string
13 */
14 private static $base_api_url = 'https://formidableforms.com/wp-json/s11-sites/v1/youtube-feed/';
15
16 /**
17 * The cache key names.
18 *
19 * @var string
20 */
21 protected $cache_key = 'frm_yt_videos';
22
23 public function __construct() {
24 // Don't load license key or dynamic cache key.
25 }
26
27 /**
28 * @return string
29 */
30 protected function api_url() {
31 return self::$base_api_url;
32 }
33
34 /**
35 * Get the YouTube video. It gets the data from cache, if cache is no available it will make a new request to YouTube API.
36 *
37 * @param string $type The video type that will be fetched: welcome|featured|latest.
38 *
39 * @return array
40 */
41 public function get_video( $type = 'welcome' ) {
42 $videos = $this->get_api_info();
43 if ( isset( $videos[ $type ] ) ) {
44 return $videos[ $type ];
45 }
46 return array();
47 }
48 }
49