PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.1.36
Gallery : FooGallery v3.1.36
3.3.2 3.3.3 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 / extensions / default-templates / class-default-templates.php
foogallery / extensions / default-templates Last commit date
carousel 2 months ago default 2 months ago image-viewer 2 months ago justified 2 months ago masonry 2 months ago shared 2 months ago simple-portfolio 2 months ago thumbnail 2 months ago class-default-templates-extension.php 2 months ago class-default-templates.php 2 months ago functions.php 2 months ago
class-default-templates.php
62 lines
1 <?php
2 /**
3 * Class to include and init default templates.
4 * The templates are no longer an extension and are built in and included by default
5 */
6
7 if ( ! class_exists( 'FooGallery_Default_Templates' ) ) {
8
9 define( 'FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_URL', plugin_dir_url( __FILE__ ) );
10 define( 'FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH', plugin_dir_path( __FILE__ ) );
11
12 define( 'FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_URL . 'shared/' );
13 define( 'FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_PATH', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'shared/' );
14
15 require_once FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'functions.php';
16 require_once FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'default/class-default-gallery-template.php';
17 require_once FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'image-viewer/class-image-viewer-gallery-template.php';
18 require_once FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'justified/class-justified-gallery-template.php';
19 require_once FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'masonry/class-masonry-gallery-template.php';
20 require_once FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'simple-portfolio/class-simple-portfolio-gallery-template.php';
21 require_once FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'thumbnail/class-thumbnail-gallery-template.php';
22 require_once FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_PATH . 'carousel/class-carousel-gallery-template.php';
23
24 class FooGallery_Default_Templates {
25
26 function __construct() {
27 new FooGallery_Default_Gallery_Template();
28 new FooGallery_Image_Viewer_Gallery_Template();
29 new FooGallery_Justified_Gallery_Template();
30 new FooGallery_Masonry_Gallery_Template();
31 new FooGallery_Simple_Portfolio_Gallery_Template();
32 new FooGallery_Thumbnail_Gallery_Template();
33 new FooGallery_Carousel_Gallery_Template();
34
35 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
36 }
37
38 /***
39 * Enqueue the assets needed by the default templates
40 * @param $hook_suffix
41 */
42 function enqueue_assets( $hook_suffix ){
43 $screen = get_current_screen();
44
45 if ( is_object( $screen ) && FOOGALLERY_CPT_GALLERY == $screen->post_type ){
46
47 // Register, enqueue scripts and styles here
48 wp_enqueue_style( 'foogallery-core-admin-settings', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'css/admin-foogallery.css', array(), FOOGALLERY_VERSION );
49
50 if ( foogallery_wp_version_major() >= 7 ) {
51 wp_enqueue_style(
52 'foogallery-core-admin-modern',
53 FOOGALLERY_URL . 'css/admin-foogallery-modern.css',
54 array( 'foogallery-core-admin-settings' ),
55 FOOGALLERY_VERSION
56 );
57 }
58 }
59 }
60 }
61 }
62