PluginProbe ʕ •ᴥ•ʔ
Photo Gallery by FooGallery : Responsive Image Gallery, Masonry Gallery & Carousel / trunk
Photo Gallery by FooGallery : Responsive Image Gallery, Masonry Gallery & Carousel vtrunk
trunk 1.10.3 2.0.24 2.1.34 2.2.44 2.3.3 2.4.32 3.0.6 3.1.11 3.1.12 3.1.13 3.1.20 3.1.25 3.1.26 3.1.26.1 3.1.26.2
foogallery / includes / extensions / class-extension.php
foogallery / includes / extensions Last commit date
class-extension.php 7 months ago class-extensions-api.php 7 months ago class-extensions-loader.php 7 months ago
class-extension.php
58 lines
1 <?php
2 /**
3 * FooGallery Extension Class that holds all information about an extension
4 *
5 * Date: 19/03/2017
6 */
7 if ( ! class_exists( 'FooGallery_Extension' ) ) {
8
9 class FooGallery_Extension extends stdClass {
10
11 /**
12 * private constructor
13 *
14 * @param array $array
15 */
16 private function __construct( $array = null ) {
17 if ( $array !== null ) {
18 $this->load( $array );
19 }
20 }
21
22 private function convertToObject( $array, $parent = null ) {
23 $object = ( null === $parent ) ? $this : new stdClass();
24 foreach ( $array as $key => $value ) {
25 if ( is_array( $value ) ) {
26 $value = convertToObject( $value, $object );
27 }
28 $object->$key = $value;
29 }
30 return $object;
31 }
32
33 function load( $array ) {
34 $this->convertToObject( $array );
35 // 'slug' => 'foobox',
36 // 'class' => 'FooGallery_FooBox_Extension',
37 // 'categories' => array( 'Featured', 'Premium' ),
38 // 'file' => 'foobox.php',
39 // 'title' => 'FooBox PRO',
40 // 'description' => 'The best lightbox for WordPress just got even better!',
41 // 'price' => '$27',
42 // 'author' => 'FooPlugins',
43 // 'author_url' => 'https://fooplugins.com',
44 // 'thumbnail' => '/assets/extension_bg.png',
45 // 'tags' => array( 'premium', 'lightbox', ),
46 // 'source' => 'fooplugins',
47 // 'download_button' =>
48 // array(
49 // 'text' => 'Buy - $27',
50 // 'target' => '_blank',
51 // 'href' => 'https://fooplugins.com/plugins/foobox',
52 // 'confirm' => false,
53 // ),
54 // 'activated_by_default' => true,
55 // 'minimum_version' => '2.3.2',
56 }
57 }
58 }