Ticket #15000: 15000.diff
File 15000.diff, 1.6 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/template.php
859 859 * @param string $id String for use in the 'id' attribute of tags. 860 860 * @param string $title Title of the meta box. 861 861 * @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). 863 863 * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). 864 864 * @param string $priority The priority within the context where the boxes should show ('high', 'low'). 865 865 */ 866 function add_meta_box($id, $title, $callback, $page , $context = 'advanced', $priority = 'default', $callback_args=null) {866 function add_meta_box($id, $title, $callback, $pages, $context = 'advanced', $priority = 'default', $callback_args=null) { 867 867 global $wp_meta_boxes; 868 868 869 869 if ( !isset($wp_meta_boxes) ) 870 870 $wp_meta_boxes = array(); 871 872 foreach( (array) $pages as $page ) : 873 871 874 if ( !isset($wp_meta_boxes[$page]) ) 872 875 $wp_meta_boxes[$page] = array(); 873 876 if ( !isset($wp_meta_boxes[$page][$context]) ) … … 912 915 $wp_meta_boxes[$page][$context][$priority] = array(); 913 916 914 917 $wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $callback_args); 918 919 endforeach; 915 920 } 916 921 917 922 /**