1 | <?php |
||
8 | class FooGallery_Attachment_Custom_Class { |
||
|
|||
9 | |||
10 | function __construct() { |
||
14 | |||
15 | /** |
||
16 | * Adds a custom class field to the attachments |
||
17 | * |
||
18 | * @param $fields array |
||
19 | * |
||
20 | * @return array |
||
21 | */ |
||
22 | function add_custom_class_field( $fields ) { |
||
32 | |||
33 | /** |
||
34 | * Alters the actual link output to include the custom class added |
||
35 | * |
||
36 | * @uses "foogallery_attachment_html_link_attributes" filter |
||
37 | * |
||
38 | * @param $attr |
||
39 | * @param $args |
||
40 | * @param object|FooGalleryAttachment $object |
||
41 | * |
||
42 | * @return array |
||
43 | */ |
||
44 | function alter_class_attributes( $attr, $args, $object ) { |
||
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.