Autocomplete WordPress Hooks for VS Code
This extension provides autocomplete support for WordPress action and filter names, and the corresponding callback function.
Last updated for WordPress 5.5.
Start typing the name of a WordPress action or filter within
Autocomplete is also provided for the callback function. It's contextually aware and provides options for a function, a class method, a closure, an arrow function, and WordPress' built-in utility functions:
An autocompleted closure callback looks like this:
Parameter types, the return type, and a docblock are included where appropriate. The behaviour of these can be adjusted in the settings for the extension.
Which functions does the autocomplete list work with?
How can I trigger the autocomplete list if it doesn't show up?
Place your cursor within the first parameter of one of the supported functions, eg
Can I disable or adjust the type declarations / type hints / docblock?
Yes, open the preferences for VS Code and go to the Extensions -> Autocomplete WordPress Hooks section.
Where does the list of hook names come from?
They're generated directly from the WordPress core software and updated in time for each new release. They're bundled with this extension so there's no requirement for your project to include WordPress if you don't want to, and the extension doesn't scan the files in your project looking for actions and filters.
This extension is free and open source software. It's licensed under the GNU GPL version 3.