| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | function add_attributes($attr, $args, $attachment) { |
||
| 45 | if ( class_exists( 'Responsive_Lightbox' ) ) { |
||
| 46 | $lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' ); |
||
| 47 | |||
| 48 | //only add attributes if the dfactory lightbox is in use |
||
| 49 | if ( 'dfactory' === $lightbox ) { |
||
| 50 | $attr['data-rel'] = 'lightbox'; |
||
| 51 | |||
| 52 | if ( !empty( $attachment->caption ) ) { |
||
| 53 | $attr['title'] = $attachment->caption; |
||
| 54 | } |
||
| 55 | } |
||
| 56 | } |
||
| 57 | |||
| 58 | return $attr; |
||
| 59 | } |
||
| 60 | } |
||
| 61 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.