[wp-trac] [WordPress Trac] #28216: Allow to register pre-instantiated widgets
WordPress Trac
noreply at wordpress.org
Fri Apr 29 21:47:52 UTC 2016
#28216: Allow to register pre-instantiated widgets
-------------------------------+--------------------------
Reporter: Denis-de-Bernardy | Owner: westonruter
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.6
Component: Widgets | Version: 3.9.1
Severity: normal | Resolution: fixed
Keywords: has-patch commit | Focuses:
-------------------------------+--------------------------
Comment (by jdgrimes):
Replying to [comment:20 westonruter]:
> @PeterRKnight How fortunate that `spl_object_hash()` is available in PHP
5.2! However, I see it is used in `_wp_filter_build_unique_id()` but has
an alternate case for handling if the function is not defined. This
worried me in that perhaps the function could be disabled in 5.2. But see
[https://core.trac.wordpress.org/ticket/21267#comment:4 #21267]:
>
> > Since PHP 5.2 (the required version for WP is 5.2.4),
{{{spl_object_hash}}} exists, which means the {{{else}}} statement and
{{{function_exists()}}} check are completely useless in
{{{_wp_filter_build_unique_id()}}}
>
> So I think we're safe.
The reason that the `function_exists()` check is needed is that the SPL
extension can be disabled prior to PHP 5.3.0. So in 5.2.0 it is on by
default but [https://secure.php.net/manual/en/spl.installation.php prior
to 5.3.0 it can be disabled]. In which case the functions that it provides
wouldn't be available.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28216#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list