I need to modify the query of one of my views. I've found hook_views_query_alter()
, but can't for the life of me figure out what I'm supposed to do with it. According to the API,
This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. MODULENAME.views.inc must be in the directory specified by the 'path' key returned by MODULENAME_views_api(), or the same directory as the .module file, if 'path' is unspecified.
OK, so I know to put the function with the hook in a views.inc file. But what do I need to put in the actual .module file? I can't seem to find any examples of complete module code that uses this hook to point me in the right direction. Does my module code contain the MODULENAME_views_api()
and nothing else?