Skip to content

Commit 06b3f67

Browse files
authored
Merge pull request #464 from cloudinary/uat
Uat
2 parents 10f7185 + 9985e40 commit 06b3f67

17 files changed

+764
-121
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.3
1+
2.7.4-rc-4

php/class-beta.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
/**
3+
* Cloudinary Beta, to add functionality under a beta filter.
4+
*
5+
* @package Cloudinary
6+
*/
7+
8+
namespace Cloudinary;
9+
10+
/**
11+
* Plugin Beta class.
12+
*/
13+
class Beta {
14+
15+
/**
16+
* Holds the core plugin.
17+
*
18+
* @var Plugin
19+
*/
20+
protected $plugin;
21+
22+
/**
23+
* Holds a list of Beta components.
24+
*
25+
* @var array
26+
*/
27+
protected $components;
28+
29+
/**
30+
* Component constructor.
31+
*
32+
* @param Plugin $plugin Global instance of the main plugin.
33+
*/
34+
public function __construct( Plugin $plugin ) {
35+
$this->plugin = $plugin;
36+
37+
$this->components = array(
38+
'delivery' => array(
39+
'class' => 'Cloudinary\Delivery',
40+
'name' => __( 'New Delivery method', 'cloudinary' ),
41+
'options' => array(),
42+
),
43+
);
44+
45+
foreach ( $this->components as $key => $data ) {
46+
/**
47+
* Filter to enable beta features for testing.
48+
*
49+
* @hook cloudinary_beta
50+
* @default false
51+
*
52+
* @param $enable {bool} Flag to enable beta features.
53+
* @param $feature {string} Optional feature type.
54+
* @param $data {array} The beta feature data.
55+
*
56+
* @return {bool}
57+
*/
58+
if ( apply_filters( 'cloudinary_beta', false, $key, $data ) ) {
59+
$this->plugin->components[ $key ] = new $data['class']( $this->plugin );
60+
}
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)