Created
November 13, 2018 15:26
-
-
Save init90/1dc7f30f83c7440a6b1bc75c47514386 to your computer and use it in GitHub Desktop.
Drupal 7, modify views filter settings programality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$views_name = 'newest_products'; | |
$display_name = 'page'; | |
$filter_name = 'type'; | |
// Add content type to allowed list in filter settings. | |
$view = views_get_view($views_name, TRUE); | |
$views_filters = $view->display[$display_name]->display_options['filters']; | |
$views_filters[$filter_name]['value'][$bundle_name] = $bundle_name; | |
$view->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment