bobbingwide / oik-bwtrace

debug trace for WordPress
https://www.oik-plugins.com/oik-plugins/oik-bwtrace-debug-trace-for-wordpress/
GNU General Public License v2.0
6 stars 1 forks source link

Ad hoc tracing should allow selection of the hook priority #10

Closed bobbingwide closed 9 years ago

bobbingwide commented 9 years ago

For the new textarea fields in #2, #3 and #6 it should be possible to specify the priority at which the trace hook should be added. This may help when attempting to track down problems that occur when there are multiple functions attached to a hook.

Proposed solution

The comma separated list of hooks may optionally include the priority. e.g. for tracing of filter function results we might use

the_content:2,the_content;9999

The separator could be a colon, or semicolon. Whitespace surrounding the hook names should be supported, but we should allow for hooks that contain embedded spaces.

bobbingwide commented 9 years ago

It would also be nice if the hook priority were to appear in the trace output. I have developed a hacky solution that applies the priority to the $accepted_args parameter so that the value becomes a decimal number. We start with 9, and append the priority giving strings such as 9.0, 9.11, 9.9999. This is extracted and written to the trace record.

I've raised an enhancement request on WordPress. https://core.trac.wordpress.org/ticket/33886