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