carousel
4 weeks ago
default
4 weeks ago
image-viewer
4 weeks ago
justified
4 weeks ago
masonry
4 weeks ago
shared
4 weeks ago
simple-portfolio
4 weeks ago
thumbnail
4 weeks ago
class-default-templates-extension.php
4 weeks ago
class-default-templates.php
4 weeks ago
functions.php
4 weeks ago
functions.php
51 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | exit; |
| 5 | } |
| 6 | |
| 7 | /** |
| 8 | * FooGallery default extensions common functions |
| 9 | */ |
| 10 | |
| 11 | /** |
| 12 | * Enqueue the core FooGallery stylesheet used by all default templates |
| 13 | */ |
| 14 | function foogallery_enqueue_core_gallery_template_style() { |
| 15 | $filename = foogallery_is_debug() ? '' : '.min'; |
| 16 | $css = apply_filters( 'foogallery_core_gallery_style', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'css/foogallery' . $filename . '.css' ); |
| 17 | foogallery_enqueue_style( 'foogallery-core', $css, array(), FOOGALLERY_VERSION ); |
| 18 | |
| 19 | $feature_deps = apply_filters( 'foogallery_feature_style_deps', array( 'foogallery-core' ) ); |
| 20 | |
| 21 | if ( foogallery_get_setting( 'custom_css', '' ) !== '' ) { |
| 22 | $custom_assets = get_option( FOOGALLERY_OPTION_CUSTOM_ASSETS ); |
| 23 | if ( is_array( $custom_assets ) && array_key_exists( 'style', $custom_assets ) ) { |
| 24 | foogallery_enqueue_style( 'foogallery-custom', $custom_assets['style'], $feature_deps, FOOGALLERY_VERSION ); |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Enqueue the core FooGallery script used by all default templates |
| 31 | * |
| 32 | * @param string[] $deps |
| 33 | */ |
| 34 | function foogallery_enqueue_core_gallery_template_script( $deps = null ) { |
| 35 | FooGallery_Delayed_Runtime_Loader::instance()->enqueue_core_gallery_template_script( $deps ); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * @return void |
| 40 | * |
| 41 | */ |
| 42 | function foogallery_enqueue_polyfills() { |
| 43 | $suffix = foogallery_is_debug() ? '' : '.min'; |
| 44 | $src = apply_filters( 'foogallery_polyfills_src', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'js/foogallery.polyfills' . $suffix . '.js', $suffix ); |
| 45 | |
| 46 | //resolve the asset URL to a fingerprinted version if available. |
| 47 | $src = foogallery_resolve_asset_url( $src ); |
| 48 | |
| 49 | wp_enqueue_script( 'foogallery-polyfills', $src, array(), FOOGALLERY_VERSION ); |
| 50 | } |
| 51 |