PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.3.0
Gallery : FooGallery v3.3.0
3.3.0 3.1.31 3.1.32 3.1.34 3.1.36 3.2.0 3.2.6 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 1 week ago class-extensions-api.php 1 week ago class-extensions-loader.php 1 week ago
class-extension.php
64 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 /**
8 * FooGallery Extension Class that holds all information about an extension
9 *
10 * Date: 19/03/2017
11 */
12 if ( ! class_exists( 'FooGallery_Extension' ) ) {
13
14 class FooGallery_Extension extends stdClass {
15
16 /**
17 * private constructor
18 *
19 * @param array $array
20 */
21 private function __construct( $array = null ) {
22 if ( $array !== null ) {
23 $this->load( $array );
24 }
25 }
26
27 private function convertToObject( $array, $parent = null ) {
28 $object = ( null === $parent ) ? $this : new stdClass();
29 foreach ( $array as $key => $value ) {
30 if ( is_array( $value ) ) {
31 $value = convertToObject( $value, $object );
32 }
33 $object->$key = $value;
34 }
35 return $object;
36 }
37
38 function load( $array ) {
39 $this->convertToObject( $array );
40 // 'slug' => 'foobox',
41 // 'class' => 'FooGallery_FooBox_Extension',
42 // 'categories' => array( 'Featured', 'Premium' ),
43 // 'file' => 'foobox.php',
44 // 'title' => 'FooBox PRO',
45 // 'description' => 'The best lightbox for WordPress just got even better!',
46 // 'price' => '$27',
47 // 'author' => 'FooPlugins',
48 // 'author_url' => 'https://fooplugins.com',
49 // 'thumbnail' => '/assets/extension_bg.png',
50 // 'tags' => array( 'premium', 'lightbox', ),
51 // 'source' => 'fooplugins',
52 // 'download_button' =>
53 // array(
54 // 'text' => 'Buy - $27',
55 // 'target' => '_blank',
56 // 'href' => 'https://fooplugins.com/plugins/foobox',
57 // 'confirm' => false,
58 // ),
59 // 'activated_by_default' => true,
60 // 'minimum_version' => '2.3.2',
61 }
62 }
63 }
64