| 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 |
// Compatible https://wordpress.org/plugins/pdf-image-generator/ |
| 25 |
if ( class_exists( 'PIGEN' ) ) { |
| 26 |
$opt = get_option( 'pigen_options' ); |
| 27 |
if ( isset( $opt['hidethumb'] ) && $opt['hidethumb'] !== '' ) { |
| 28 |
$where[] = " posts.ID NOT IN (SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_thumbnail_id') "; |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
return $where; |
| 33 |
} |
| 34 |
} |