| 1 |
<?php |
| 2 |
namespace FileBird\Controller; |
| 3 |
|
| 4 |
class Exclude { |
| 5 |
public function __construct() { |
| 6 |
add_filter( 'fbv_get_count_where_query', array( $this, 'exclude_get_count_where_query' ), 10, 1 ); |
| 7 |
} |
| 8 |
|
| 9 |
public function exclude_get_count_where_query( $where ) { |
| 10 |
global $wpdb; |
| 11 |
if ( function_exists( '_is_elementor_installed' ) ) { |
| 12 |
$where[] = " posts.ID NOT IN (SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_elementor_is_screenshot') "; |
| 13 |
} |
| 14 |
|
| 15 |
if ( function_exists( 'picu_exclude_collection_images_from_library' ) ) { |
| 16 |
$where[] = " posts.post_parent NOT IN (SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} WHERE {$wpdb->posts}.post_type = 'picu_collection') "; |
| 17 |
} |
| 18 |
|
| 19 |
if ( function_exists( 'uncode_get_gallery_attachment_ids' ) ) { |
| 20 |
$media_attachments_ids = implode( ',', uncode_get_gallery_attachment_ids() ); |
| 21 |
$where[] = "posts.ID NOT IN ($media_attachments_ids)"; |
| 22 |
} |
| 23 |
|
| 24 |
return $where; |
| 25 |
} |
| 26 |
} |