Opened 11 years ago
Closed 11 years ago
#35896 closed defect (bug) (duplicate)
login_enqueue_scripts document bug
| Reported by: | suifengtec | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Script Loader | Version: | 4.4.2 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
the example on this document page is error:
https://codex.wordpress.org/Plugin_API/Action_Reference/login_enqueue_scripts#Example
the scripts/styles enqueued by this hook is only output before
</body>
the correct method using it may be:
<?php add_action('login_enqueue_scripts', array('login_enqueue_scripts')); function login_enqueue_scripts(){ printf("<link rel='stylesheet' id='%s' href='%s' type='text/css' media='all' >\n", 'css-id', esc_url(plugins_url(__FILE__).'assets/css/style.css') ); }
Change History (2)
#2
@
11 years ago
- Component Administration → Script Loader
- Focuses accessibility docs removed
- Keywords needs-docs removed
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
- Type enhancement → defect (bug)
Hello @suifengtec,
the example in the codex is correct, that's how core is currently handling stylesheets on the login page. But there is a ticket to improve this behavior, see #17916.
Note: The codex is a wiki, everyone with a WordPress.org account can edit the pages.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)