WordPress.org

Make WordPress Core

Ticket #18285: extra-args.18285.2.diff

File extra-args.18285.2.diff, 1.3 KB (added by scribu, 3 years ago)
  • wp-admin/includes/template.php

    diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
    index 17ba5b0..7afcffe 100644
    a b function add_settings_section($id, $title, $callback, $page) { 
    10981098        if ( !isset($wp_settings_sections[$page][$id]) ) 
    10991099                $wp_settings_sections[$page][$id] = array(); 
    11001100 
    1101         $wp_settings_sections[$page][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback); 
     1101        $wp_settings_sections[$page][$id] = compact( 'id', 'title', 'callback' ); 
    11021102} 
    11031103 
    11041104/** 
    function add_settings_field($id, $title, $callback, $page, $section = 'default', 
    11381138        if ( !isset($wp_settings_fields[$page][$section]) ) 
    11391139                $wp_settings_fields[$page][$section] = array(); 
    11401140 
    1141         $wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args); 
     1141        $wp_settings_fields[$page][$section][$id] = compact( 'id', 'title', 'callback', 'args' ); 
    11421142} 
    11431143 
    11441144/** 
    function do_settings_fields($page, $section) { 
    11991199                else 
    12001200                        echo '<th scope="row">' . $field['title'] . '</th>'; 
    12011201                echo '<td>'; 
    1202                 call_user_func($field['callback'], $field['args']); 
     1202                call_user_func($field['callback'], $field['args'], $field['id'], $section, $page); 
    12031203                echo '</td>'; 
    12041204                echo '</tr>'; 
    12051205        }