Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add your own hooks #4

Open
soderlind opened this issue Nov 28, 2019 · 3 comments
Open

Feature request: Add your own hooks #4

soderlind opened this issue Nov 28, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@soderlind
Copy link

It would be very nice if I could add my own hooks, i.e:

  • Generate hooks using your wp-hooks-generator
  • Point to the hooks using vscode preferences, and add support for per workspace eg:
{
    "wordpress-hooks.core" : 1,
    "wordpress-hooks.local-actions": "${workspaceFolder}/hooks/actions.json",
    "wordpress-hooks.local-filters": "${workspaceFolder}/hooks/filters.json"
}

re wordpress-hooks.core, if (when) you're adding this option, it might be nice to be able to disable core hooks

@johnbillion johnbillion added the enhancement New feature or request label Feb 17, 2020
@johnbillion
Copy link
Collaborator

Thinking out loud:

I would quite like for the extension to auto-detect the existence of ${workspaceFolder}/hooks/(actions|filters).json files, and prompt the user to use them for autocompletion if they exist.

If the user chooses Yes then the extension adds the paths to a setting stored in the workspace config which is an array that lists the paths of files to use for actions and filters.

If the user chooses No, it adds the same paths to the same config but with a value of false so the user isn't prompted again and the paths aren't used.

The setting to use the core actions and filters can just be a manual one for now.

I've no idea if extensions can write to settings, I'll investigate.

@danieliser
Copy link

Any movement on this, or way to load custom hooks filters?

@johnbillion
Copy link
Collaborator

Not yet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants