force_suppress_filters = true
- 类型
- action
- 类别
- 获取本地化内容
- WPML 版本
- 4.7.2
说明
默认情况下,WPML Media Translation 插件会按语言筛选附件查询。这是通过为内置的 get_posts 函数设置 suppress_filters=false 来实现的。force_suppress_filters 操作会覆盖此设置,允许您一次性检索所有语言的所有附件。
使用示例
示例
$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
));
相关钩子
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