Giter Site home page Giter Site logo

muskanmahajan37 / vscode-wordpress-hooks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wp-hooks/vscode-wordpress-hooks

0.0 0.0 0.0 1.23 MB

VS Code extension for autocomplete support for WordPress actions and filters

Home Page: https://marketplace.visualstudio.com/items?itemName=johnbillion.vscode-wordpress-hooks

License: GNU General Public License v3.0

TypeScript 96.59% JavaScript 3.41%

vscode-wordpress-hooks's Introduction

WordPress Hooks Intellisense for VS Code

This 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 5.7
  • 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:

Screenshot of VS Code showing an autocomplete list for the first parameter of the add_filter function

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:

Screenshot of VS Code showing an autocomplete list for the callback parameter of the add_filter function

An autocompleted closure callback looks like this:

Screenshot of VS Code showing a completed callback closure for the add_filter function

Hover information for an action or filter name looks like this:

Screenshot of VS Code showing hover information for an action

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()

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 -> WordPress Hooks Intellisense 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

Development of this extension is sponsored by:

Automattic

Plus all my kind sponsors on GitHub:

Sponsors

Click here to find out about supporting this extension and my other WordPress development tools and plugins.

License

This extension is free and open source software. It's licensed under the GNU GPL version 3.

Thanks

vscode-wordpress-hooks's People

Contributors

danielpost avatar johnbillion avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.