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

Asset handle should be a public constant #119

Closed
dingo-d opened this issue Dec 15, 2020 · 0 comments · Fixed by #306
Closed

Asset handle should be a public constant #119

dingo-d opened this issue Dec 15, 2020 · 0 comments · Fixed by #306
Assignees
Labels
improvement Small improvement fixes, either readability or performance improvements

Comments

@dingo-d
Copy link
Collaborator

dingo-d commented Dec 15, 2020

$handle = "{$this->getAssetsPrefix()}-styles";

Sometimes, especially in plugins and places when we need to extend or reference it, like when we want to use wp_set_script_translations, we need to get the handle where we can hook into.

Currently, that's not possible. When extending the class I need to manually add this.

If this was a constant I could just reference it using self::JS_ADMIN_HANDLE or something like that. This applies to every enqueue class (theme and block).

@dingo-d dingo-d added improvement Small improvement fixes, either readability or performance improvements enhancement labels Dec 15, 2020
@dingo-d dingo-d added this to the v3.0.1 milestone Dec 15, 2020
@iruzevic iruzevic modified the milestones: v3.0.1, v3.0.2 Jan 13, 2021
@dingo-d dingo-d modified the milestones: v3.0.2, v3.1.0, 3.1.0, Future release Feb 24, 2021
@iruzevic iruzevic modified the milestones: Future release, 4.1.0 Jun 27, 2021
@iruzevic iruzevic changed the title [FEATURE] Asset handle should be a public constant Asset handle should be a public constant Dec 7, 2021
@dingo-d dingo-d modified the milestones: 4.1.0, 4.2.0 Feb 17, 2022
@iruzevic iruzevic self-assigned this Mar 18, 2022
@iruzevic iruzevic modified the milestones: 4.2.0, 5.0.0, 4.3.0 Mar 18, 2022
@iruzevic iruzevic removed this from the 4.3.0 milestone Apr 14, 2022
@JerrySpecter JerrySpecter linked a pull request Jun 28, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Small improvement fixes, either readability or performance improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants