[wp-trac] [WordPress Trac] #19906: Quicktags docs recommend code causing JS error: Uncaught ReferenceError: QTags is not defined
WordPress Trac
noreply at wordpress.org
Mon Aug 12 22:11:11 UTC 2013
#19906: Quicktags docs recommend code causing JS error: Uncaught ReferenceError:
QTags is not defined
-------------------------------+------------------------------
Reporter: jeremyclarke | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Inline Docs | Version: 3.3.1
Severity: trivial | Resolution: wontfix
Keywords: needs-codex close |
-------------------------------+------------------------------
Changes (by c3mdigital):
* keywords: has-patch needs-codex dev-feedback => needs-codex close
* status: reopened => closed
* resolution: => wontfix
Comment:
The proper way to enqueue or add inline javascript via
'admin_print_footer_scripts' is to do check early in the function so that
your scrip is only output on the pages intended.
{{{
function output_my_js() {
global $pagenow;
if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php' ) )
return;
// your js
}
}}}
I don't think we need the recommendation inline but it would be a nice
codex example.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19906#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list