@@ 79-96 (lines=18) @@ | ||
76 | * so that they don't seem to display twice. |
|
77 | */ |
|
78 | add_filter( 'ajax_query_attachments_args', 'videopress_ajax_query_attachments_args' ); |
|
79 | function videopress_ajax_query_attachments_args( $args ) { |
|
80 | $meta_query = array( |
|
81 | array( |
|
82 | 'key' => 'videopress_poster_image', |
|
83 | 'compare' => 'NOT EXISTS', |
|
84 | ), |
|
85 | ); |
|
86 | ||
87 | // If there was already a meta query, let's AND it via |
|
88 | // nesting it with our new one. No need to specify the |
|
89 | // relation, as it defaults to AND. |
|
90 | if ( ! empty( $args['meta_query'] ) ) { |
|
91 | $meta_query[] = $args['meta_query']; |
|
92 | } |
|
93 | $args['meta_query'] = $meta_query; |
|
94 | ||
95 | return $args; |
|
96 | } |
|
97 | ||
98 | /** |
|
99 | * Media List: |
@@ 79-96 (lines=18) @@ | ||
76 | * so that they don't seem to display twice. |
|
77 | */ |
|
78 | add_filter( 'ajax_query_attachments_args', 'videopress_ajax_query_attachments_args' ); |
|
79 | function videopress_ajax_query_attachments_args( $args ) { |
|
80 | $meta_query = array( |
|
81 | array( |
|
82 | 'key' => 'videopress_poster_image', |
|
83 | 'compare' => 'NOT EXISTS', |
|
84 | ), |
|
85 | ); |
|
86 | ||
87 | // If there was already a meta query, let's AND it via |
|
88 | // nesting it with our new one. No need to specify the |
|
89 | // relation, as it defaults to AND. |
|
90 | if ( ! empty( $args['meta_query'] ) ) { |
|
91 | $meta_query[] = $args['meta_query']; |
|
92 | } |
|
93 | $args['meta_query'] = $meta_query; |
|
94 | ||
95 | return $args; |
|
96 | } |
|
97 | ||
98 | /** |
|
99 | * Media List: |