force_suppress_filters = true
- Type
- action
- Category
- Retrieving Localized Content
- WPML Version
- 4.7.2
Description
By default, the WPML Media Translation plugin filters attachment queries by language. This is done by setting suppress_filters=false for built-in get_posts functions. The force_suppress_filters action overrides this setting to allow you to retrieve all attachments in all languages at once.
Example usage
Example
$posts = get_posts( array(
'post_type' => 'attachment',
'numberposts' => -1,
'force_suppress_filters' => true, // Argument to allow get_posts ignore WPML action that makes suppres_filter=false and query all attachments
));
Related hooks
wpml_media_url, wpml_media_id, wpml_get_translated_slug, wpml_home_url, wpml_translate_single_string, wpml_translate_string, wpml_elements_without_translations, wpml_permalink, wpml_unfiltered_admin_string, wpml_element_link