Make WordPress Core

Opened 2 years ago

#42925 new defect (bug)

register_setting backwards compatibility when function defined after registration

Reported by: ItayXD Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.1
Component: General Keywords:
Focuses: Cc:


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.

Change History (0)

Note: See TracTickets for help on using tickets.