Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function add_video_class_to_item( $classes, $foogallery_attachment, $args ) { |
||
26 | if ( class_exists( 'Foo_Video' ) ) { |
||
27 | $video_info = get_post_meta( $foogallery_attachment->ID, FOO_VIDEO_POST_META, true ); |
||
28 | if ( $video_info && isset( $video_info['id'] ) ) { |
||
29 | //we are dealing with a video |
||
30 | $classes[] = 'fg-video'; |
||
31 | |||
32 | //include a specific css file to override issues with video hover effects |
||
33 | $css = FOOGALLERY_URL . 'css/foogallery-foovideo-overrides.css'; |
||
34 | foogallery_enqueue_style( 'foogallery_foovideo_overrides', $css, array(), FOOGALLERY_VERSION ); |
||
35 | } |
||
36 | } |
||
37 | |||
38 | return $classes; |
||
39 | } |
||
40 | } |
||
42 |
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.