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

why get_style_depends() is final mehtod? #3494

Closed
guytzhak opened this issue Feb 16, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@guytzhak
Copy link

commented Feb 16, 2018

Hi,
The method 'get_style_depends' is final methor dislike the method 'get_script_depends' that isn't final method and help to add depends foreach widget.

why is that? Why you do doesn't let to add custom styles for widgets only if they arer calling?

Thanks

@KingYes

This comment has been minimized.

Copy link
Member

commented Feb 19, 2018

You need to use with add_style_depends() method to add styles.

@tristanleboss

This comment has been minimized.

Copy link

commented Feb 19, 2018

I have the same question... I don't understand why for scripts we can override get_script_depends but not for styles (get_style_depends). These methods are exactly the same: they work on two arrays depended_styles and depended_scripts. These arrays are used by two twin functions get_style_depends and get_script_depends which are in turn used by two twin functions enqueue_styles and enqueue_scripts.

Btw, it would be cool to have 2 functions add_style_depends_frontend and add_style_depends_editor or, even better, a parameter (editor, frontend, both) for the actual functions to let the system know when the script/style has to be included. Because today, I didn't find a clean way to separate the scripts for the frontend and the editor. Maybe, I missed something?

@guytzhak

This comment has been minimized.

Copy link
Author

commented Feb 20, 2018

@KingYes
Understand, But like @tristanleboss said. it could make us confused when it doesn't work like 'get_script_depends' function.

Thanks!

@KingYes

This comment has been minimized.

Copy link
Member

commented Feb 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.