You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This VS Code extension provides IntelliSense and autocomplete for WordPress hooks, actions, and filters.
Autocomplete for action and filter names
Supports all actions and filters up to WordPress 6.8
Autocomplete for action and filter callback functions
Supports functions, class methods, closures, arrow functions, and more
The parameter types, return type, and a docblock are included where appropriate
Various options can be controlled in the settings for the extension
Hover information on action and filter names
Includes a useful link to the developer.wordpress.org documentation site
Usage
Start typing the name of a WordPress action or filter within add_action() or add_filter() and you'll get an autocomplete list of all matching actions or filters, plus information about the parameters and usage:
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:
Hover information for an action or filter name looks like this:
FAQ
Which functions does the autocomplete list and hover information work with?
add_action()
add_filter()
remove_action()
remove_filter()
has_action()
has_filter()
doing_action()
doing_filter()
did_action()
did_filter()
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 add_action() or add_filter(), and hit ctrl+space. This works with any autocomplete provider, not only this extension.
Can I disable or adjust the type declarations / type hints / docblock?
Yes, open the preferences for VS Code and go to the Extensions -> Hooks IntelliSense for WordPress 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.
Sponsors
The time that I spend maintaining this extension and others is in part sponsored by: