user3563097
user3563097

Reputation: 179

After changing a views default with hook_views_default_views_alter() how can I make it active programmatically?

I have a view. I altered it with hook_views_default_views_alter(). To make my changed become active I need to go to the UI and revert it back to the altered default.

How can I make the new default active programmatically instead?

In other words: How can I alter a views default and make it active programmatically?

Upvotes: 1

Views: 369

Answers (1)

Angie Rabelero
Angie Rabelero

Reputation: 52

I don't understand what you're asking, but it sounds like you want to revert the view.

You need to include module_load_include('module', 'views') and module_load_include('inc', 'views', 'drush/views.drush'). And the function to revert all views views_revert_allviews(views_get_all_views());.

Check function hook_views_default_views_alter for more info.

Upvotes: 2

Related Questions