PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.2.6
Gallery : FooGallery v3.2.6
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 4 weeks ago admin 4 weeks ago compatibility 4 weeks ago extensions 4 weeks ago foopluginbase 4 weeks ago public 4 weeks ago thumbs 4 weeks ago asset-manifest.php 4 weeks ago class-attachment-filters.php 4 weeks ago class-command-palette.php 4 weeks ago class-foogallery-animated-gif-support.php 4 weeks ago class-foogallery-attachment-custom-class.php 4 weeks ago class-foogallery-attachment-filename.php 4 weeks ago class-foogallery-attachment-type.php 4 weeks ago class-foogallery-attachment.php 4 weeks ago class-foogallery-cache.php 4 weeks ago class-foogallery-common-fields.php 4 weeks ago class-foogallery-crop-position.php 4 weeks ago class-foogallery-datasource-media_library.php 4 weeks ago class-foogallery-debug.php 4 weeks ago class-foogallery-delayed-runtime-loader.php 4 weeks ago class-foogallery-extensions-compatibility.php 4 weeks ago class-foogallery-force-https.php 4 weeks ago class-foogallery-lazyload.php 4 weeks ago class-foogallery-license-constant-handler.php 4 weeks ago class-foogallery-lightbox.php 4 weeks ago class-foogallery-paging.php 4 weeks ago class-foogallery-password-protect.php 4 weeks ago class-foogallery-sitemaps.php 4 weeks ago class-foogallery-widget.php 4 weeks ago class-foogallery.php 4 weeks ago class-gallery-advanced-settings.php 4 weeks ago class-il8n.php 4 weeks ago class-override-thumbnail.php 4 weeks ago class-posttypes.php 4 weeks ago class-previews.php 4 weeks ago class-retina.php 4 weeks ago class-thumbnail-dimensions.php 4 weeks ago class-thumbnails.php 4 weeks ago class-version-check.php 4 weeks ago constants.php 4 weeks ago functions.php 4 weeks ago gallery-management-functions.php 4 weeks ago includes.php 4 weeks ago index.php 4 weeks ago render-functions.php 4 weeks 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