plugin updates
This commit is contained in:
@@ -400,13 +400,21 @@ class WpmfDisplayGallery
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Filter gallery query argument to get images.
|
||||
*
|
||||
* @param array Gallery query arguments
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
$args = apply_filters('wpmf_gallery_query_args', $args);
|
||||
$query = new WP_Query($args);
|
||||
$_attachments = $query->get_posts();
|
||||
$gallery_items = array();
|
||||
|
||||
$last_folder_parent = $this->getFolderParent($wpmf_folder_id[0]);
|
||||
foreach ($_attachments as $key => $val) {
|
||||
if (($last_folder_parent->slug !== 'nextcloud' || !strpos($val->post_mime_type, 'avif')) && !strpos($val->post_mime_type, 'pdf')) { // hide file pdf and avif in nextcloud folder
|
||||
if ($last_folder_parent->slug !== 'nextcloud' || !strpos($val->post_mime_type, 'avif')) { // hide avif in nextcloud folder
|
||||
$gallery_items[$val->ID] = $_attachments[$key];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user