Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. function mymodule_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
  2. foreach($query->where as &$condition_group) {
  3. foreach($condition_group['conditions'] as &$conditions) {
  4. /**
  5. * my_field_name_value is the Linked Document->media.field_document_tag.target_id (taxonomy term id)
  6. */
  7. if($condition['field'] == 'my_field_name') {
  8. $condition = [
  9. 'field' => 'my_field_name',
  10. 'value' => 'my_field_name_value',
  11. 'operator' => '=',
  12. ];
  13. }
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement