plugin updates

This commit is contained in:
Tony Volpe
2024-11-20 22:40:39 -05:00
parent 0238f0c4ca
commit 3362947c6e
434 changed files with 13405 additions and 9202 deletions

View File

@@ -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];
}
}