1 | <?php |
||
7 | class FooGalleryDatasource_MediaLibrary implements IFooGalleryDatasource { |
||
|
|||
8 | |||
9 | /** |
||
10 | * @var FooGallery |
||
11 | */ |
||
12 | private $foogallery; |
||
13 | |||
14 | /** |
||
15 | * Sets the FooGallery object we are dealing with |
||
16 | * |
||
17 | * @param $foogallery FooGallery |
||
18 | */ |
||
19 | public function setGallery( $foogallery ) { |
||
22 | |||
23 | function __construct() { |
||
31 | |||
32 | /** |
||
33 | * Returns the number of attachments used from the media library |
||
34 | * @return int |
||
35 | */ |
||
36 | public function getCount() { |
||
39 | |||
40 | /** |
||
41 | * Returns a serialized string that represents the media in the datasource. |
||
42 | * This string is persisted when saving a FooGallery |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public function getSerializedData() { |
||
53 | |||
54 | /** |
||
55 | * Returns an array of FooGalleryAttachments from the datasource |
||
56 | * @return array(FooGalleryAttachment) |
||
57 | */ |
||
58 | public function getAttachments() { |
||
82 | |||
83 | /** |
||
84 | * This forces the attachments to be fetched using the correct ordering. |
||
85 | * Some plugins / themes override this globally for some reason, so this is a preventative measure to ensure sorting is correct |
||
86 | * @param $query WP_Query |
||
87 | */ |
||
88 | public function force_gallery_ordering( $query ) { |
||
96 | |||
97 | /** |
||
98 | * Returns the featured FooGalleryAttachment from the datasource |
||
99 | * @return bool|FooGalleryAttachment |
||
100 | */ |
||
101 | public function getFeaturedAttachment() { |
||
110 | |||
111 | private function find_featured_attachment_id() { |
||
121 | } |
||
122 | } |
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.