-
Notifications
You must be signed in to change notification settings - Fork 0
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
Backport defaultDuotone option #12
Changes from 2 commits
40418ea
f2f1a7d
41080f4
18bcda6
e6ae1e1
203c064
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -574,6 +574,10 @@ | |
add_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' ); | ||
add_action( 'wp_footer', 'wp_enqueue_global_styles', 1 ); | ||
|
||
// SVG filters like duotone have to be loaded at the beginning of the body in both admin and the front-end. | ||
add_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' ); | ||
add_action( 'in_admin_header', 'wp_global_styles_render_svg_filters' ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ajlende This will load SVG filters on every admin page. We only need them on editor pages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated in 41080f4 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't find a better place for it than At least with |
||
|
||
add_action( 'wp_default_styles', 'wp_default_styles' ); | ||
add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 ); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use old logic from
should_override_preset
instead of introducing a new method and removing the old one?This method won't be private after WordPress#2322.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible. I would strongly advise against using the old one.
The old method is confusing because it returns either the boolean or the inverse of the boolean when a path is passed. Making the return consistent—the boolean or the boolean at the end of a path—is much easier to understand. And it doesn't require checking if the path argument is an array at both the call site and the method.