[wp-trac] [WordPress Trac] #16059: wp_kses_split2() is private, no need to create a function with the sole purpose to call a function.
WordPress Trac
wp-trac at lists.automattic.com
Sat Jan 1 17:06:19 UTC 2011
#16059: wp_kses_split2() is private, no need to create a function with the sole
purpose to call a function.
--------------------------+-----------------------------
Reporter: hakre | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.1
Severity: normal | Keywords: has-patch
--------------------------+-----------------------------
In the effort to remove create_function() constructs from the file
(#10623, #7363) the last one was removed in 16313 / #14424.
While the analysis in the last ticket was right that create_function() is
not needed, the resolution to introduce a named function was not.
Infact the anonymous callback function has been replaced with a named
callback function without taking into account, that a named callback
function already exists. So a function whith its sole purpose to call
another function has been introduced by the google summer of code student.
The existing functions name is wp_kses_split2(), having the needed
properties. The function is marked as private and not used anywhere else
in the file kses.php nor the whole core php code.
It can be safely adopted to fulfill the requirements of the callback
function signature.
This saves the overhead of a function call per callback call.
Additionally passing the data needs only one entry in the symbol table by
using an array.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16059>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list