#40225 closed defect (bug) (invalid)
Using wp_enqueue_style() with 'admin_enqueue_scripts' results in unresponsive "Screen Options" button
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7.3 |
Component: | Script Loader | Keywords: | |
Focuses: | ui, javascript | Cc: |
Description
Attempting to enqueue a .css file to style admin area elements using the following results in a unresponsive "screen options" button:
function load_admin_style() { wp_enqueue_style('admin_css', get_template_directory_uri() . '/library/css/style.css'); } add_action( 'admin_enqueue_scripts', 'load_admin_style' );
The .css is present and loaded correctly however.
---
Using wp_enqueue_script() results in both the .css file and the other js being loaded correctly:
function load_admin_style() { wp_enqueue_script('admin_css', get_template_directory_uri() . '/library/css/style.css'); } add_action( 'admin_enqueue_scripts', 'load_admin_style' );
Change History (3)
#1
@
8 years ago
- Component changed from General to Script Loader
- Focuses accessibility removed
- Keywords reporter-feedback added
#2
@
8 years ago
- Keywords reporter-feedback removed
- Resolution set to invalid
- Status changed from new to closed
Hi @SergeyBiryukov,
My apologies, it was indeed the .css file, swapping it with an empty .css file resolved the issue.
I'll need to do some debugging now. Sorry for having wasted your time.
Note: See
TracTickets for help on using
tickets.
Hi @shastjion, welcome to WordPress Trac! Thanks for the report.
wp_enqueue_style()
by itself should not cause any issues with "Screen Options" button, so I think there might be a CSS or JS conflict with the particular styles you're using.library/css/style.css
file?Note that the usage of
wp_enqueue_script()
is invalid here, as you're loading a CSS file in a<script>
tag.