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

Update Actions and Filters to be named consistenty #231

Open
jasonbahl opened this issue Jul 14, 2023 · 2 comments
Open

Update Actions and Filters to be named consistenty #231

jasonbahl opened this issue Jul 14, 2023 · 2 comments
Labels
actionable Effort: LOW enhancement New feature or request good first issue Good for newcomers

Comments

@jasonbahl
Copy link
Collaborator

currently the codebase has actions and filters with mixed naming conventions:

Some start with wpgraphql_cache (such as wpgraphql_cache_save_request) and some start with graphql_cache such as graphql_purge).

We should decide which prefix to use and make things consistent.

Note, we'll need to keep around the old actions/filters and deprecate them as folks could already be using them.

Some helpful info re: deprecating in here: https://juagonala.com/how-to-deprecate-code-in-wordpress/

@jasonbahl
Copy link
Collaborator Author

Note: the linter gets grumpy if we use graphql_cache instead of wpgraphql_cache (see: https://github.com/wp-graphql/wp-graphql-smart-cache/actions/runs/5555942329/jobs/10147786949?pr=230#step:7:20)

So whatever decision we make, we need to update the linter accordingly

@jasonbahl
Copy link
Collaborator Author

WPGraphQL for ACF recently made the change to using forward slashes in action and filter names.

see: wp-graphql/wpgraphql-acf#67

I think it would be good to implement this style for WPGraphQL Smart Cache as it makes things more readable (at least in my opinion) and I can more clearly understand the "domain" the hook is related to.

Something like:

wpgraphql/smart-cache/$action_name

or

wpgraphql/cache/$action_name

(not 💯 sold either way on "smart-cache" vs "cache" 🤷🏻‍♂️ )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Effort: LOW enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants