[wp-trac] [WordPress Trac] #42925: register_setting backwards compatibility when function defined after registration
WordPress Trac
noreply at wordpress.org
Sun Dec 17 15:49:29 UTC 2017
#42925: register_setting backwards compatibility when function defined after
registration
--------------------------+-----------------------------
Reporter: ItayXD | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.9.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
to make register_setting backward compatible this code is used:
{{{
if ( is_callable( $args ) ) {
$args = array(
'sanitize_callback' => $args,
);
}
}}}
so if you call register_setting with a function instead of args, and only
then define that function is_callable returns false, and the function is
never passed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42925>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list