PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.3.2
Gallery : FooGallery v3.3.2
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 / includes / class-attachment-filters.php
foogallery / includes Last commit date
abilities 2 days ago admin 2 days ago compatibility 2 days ago extensions 2 days ago foopluginbase 2 days ago public 2 days ago thumbs 2 days ago asset-manifest.php 2 days ago class-attachment-filters.php 2 days ago class-command-palette.php 2 days ago class-foogallery-animated-gif-support.php 2 days ago class-foogallery-attachment-custom-class.php 2 days ago class-foogallery-attachment-filename.php 2 days ago class-foogallery-attachment-type.php 2 days ago class-foogallery-attachment.php 2 days ago class-foogallery-cache.php 2 days ago class-foogallery-common-fields.php 2 days ago class-foogallery-crop-position.php 2 days ago class-foogallery-datasource-media_library.php 2 days ago class-foogallery-debug.php 2 days ago class-foogallery-delayed-runtime-loader.php 2 days ago class-foogallery-extensions-compatibility.php 2 days ago class-foogallery-force-https.php 2 days ago class-foogallery-lazyload.php 2 days ago class-foogallery-license-constant-handler.php 2 days ago class-foogallery-lightbox.php 2 days ago class-foogallery-no-javascript-fallback.php 2 days ago class-foogallery-paging.php 2 days ago class-foogallery-password-protect.php 2 days ago class-foogallery-sitemaps.php 2 days ago class-foogallery-widget.php 2 days ago class-foogallery.php 2 days ago class-gallery-advanced-settings.php 2 days ago class-il8n.php 2 days ago class-override-thumbnail.php 2 days ago class-posttypes.php 2 days ago class-previews.php 2 days ago class-retina.php 2 days ago class-thumbnail-dimensions.php 2 days ago class-thumbnails.php 2 days ago class-version-check.php 2 days ago constants.php 2 days ago functions.php 2 days ago gallery-management-functions.php 2 days ago includes.php 2 days ago index.php 2 days ago render-functions.php 2 days ago
class-attachment-filters.php
61 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 /**
8 * Create some template specific filters for overriding html attributes when rendering galleries
9 *
10 * So, instead of hooking into 'foogallery_attachment_html_image_attributes' and checking that the gallery template being used is 'default',
11 * now rather just hook into 'foogallery_attachment_html_image_attributes-default'.
12 */
13
14 if ( ! class_exists( 'FooGallery_Attachment_Filters' ) ) {
15 class FooGallery_Attachment_Filters {
16
17 function __construct() {
18 add_filter( 'foogallery_attachment_html_image_attributes', array( $this, 'attachment_html_image_attributes' ), 20, 3 );
19 add_filter( 'foogallery_attachment_html_link_attributes', array( $this, 'attachment_html_link_attributes' ), 20, 3 );
20 }
21
22 /**
23 * Apply a template-specific filter for overriding the image attributes
24 *
25 * @param $attr array
26 * @param $args array
27 * @param $attachment FooGalleryAttachment
28 *
29 * @return array
30 */
31 function attachment_html_image_attributes( $attr, $args, $attachment ) {
32 global $current_foogallery;
33
34 if ( $current_foogallery && $current_foogallery->gallery_template ) {
35 $attr = apply_filters( "foogallery_attachment_html_image_attributes-{$current_foogallery->gallery_template}", $attr, $args, $attachment );
36 }
37
38 return $attr;
39 }
40
41 /**
42 * Apply a template-specific filter for overriding the link attributes
43 *
44 * @param $attr array
45 * @param $args array
46 * @param $attachment FooGalleryAttachment
47 *
48 * @return array
49 */
50 function attachment_html_link_attributes( $attr, $args, $attachment ) {
51 global $current_foogallery;
52
53 if ( $current_foogallery && $current_foogallery->gallery_template ) {
54 $attr = apply_filters( "foogallery_attachment_html_link_attributes-{$current_foogallery->gallery_template}", $attr, $args, $attachment );
55 }
56
57 return $attr;
58 }
59 }
60 }
61