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