WordPress.org

Make WordPress Core

Ticket #15000: 15000.diff

File 15000.diff, 1.6 KB (added by coffee2code, 4 years ago)

Aforementioned patch.

  • wp-admin/includes/template.php

     
    859859 * @param string $id String for use in the 'id' attribute of tags. 
    860860 * @param string $title Title of the meta box. 
    861861 * @param string $callback Function that fills the box with the desired content. The function should echo its output. 
    862  * @param string $page The type of edit page on which to show the box (post, page, link). 
     862 * @param string|array $pages The type of edit page(s) on which to show the box ('post', 'page', 'link', and/or other custom post types). 
    863863 * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). 
    864864 * @param string $priority The priority within the context where the boxes should show ('high', 'low'). 
    865865 */ 
    866 function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args=null) { 
     866function add_meta_box($id, $title, $callback, $pages, $context = 'advanced', $priority = 'default', $callback_args=null) { 
    867867        global $wp_meta_boxes; 
    868868 
    869869        if ( !isset($wp_meta_boxes) ) 
    870870                $wp_meta_boxes = array(); 
     871 
     872        foreach( (array) $pages as $page ) : 
     873 
    871874        if ( !isset($wp_meta_boxes[$page]) ) 
    872875                $wp_meta_boxes[$page] = array(); 
    873876        if ( !isset($wp_meta_boxes[$page][$context]) ) 
     
    912915                $wp_meta_boxes[$page][$context][$priority] = array(); 
    913916 
    914917        $wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $callback_args); 
     918 
     919        endforeach; 
    915920} 
    916921 
    917922/**