[wp-trac] [WordPress Trac] #18512: Add backtrace details to _doing_it_wrong output
WordPress Trac
wp-trac at lists.automattic.com
Wed Aug 24 21:03:42 UTC 2011
#18512: Add backtrace details to _doing_it_wrong output
------------------------------+-------------------------------------
Reporter: chrisbliss18 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Warnings/Notices | Version:
Severity: normal | Keywords: has-patch needs-testing
------------------------------+-------------------------------------
The _doing_it_wrong function is great for notifying that there is a
problem, but it doesn't do much to help find out where the problem
originates. I made a first stab at adding some backtracking information
and have the proposed patch attached.
It outputs something like the following:
Notice: wp_enqueue_script was called <strong>incorrectly</strong>. Scripts
and styles should not be registered or enqueued until the
<code>wp_enqueue_scripts</code>, <code>admin_enqueue_scripts</code>, or
<code>init</code> hooks. (This message was added in version 3.3.) (Called
by wp-content/plugins/bad-plugin/bad-plugin.php line 23) in wp-
includes/functions.php on line 3523
Please try it out, and let me know if any modifications need to be made
for specific cases. I'm open to completely changing the way the
information is presented, I just want to be able to know from where the
issue originated so that I can quickly track it down as it often shows up
when I activate other developer's code.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18512>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list