Make WordPress Core

Ticket #15000: 15000.4.diff

File 15000.4.diff, 3.4 KB (added by egill, 11 years ago)
  • wp-admin/includes/template.php

     
    889889<?php
    890890        endif;
    891891}
    892 
    893892/**
    894893 * Add a meta box to an edit form.
    895894 *
     
    899898 * @param string           $title         Title of the meta box.
    900899 * @param callback         $callback      Function that fills the box with the desired content.
    901900 *                                        The function should echo its output.
     901 * @param mixed|WP_Screen  $screen        Optional. The screen on which to show the box (like a post
     902 *                                        type, 'link', or 'comment'). Default is the current screen.
     903 * @param string           $context       Optional. The context within the screen where the boxes
     904 *                                        should display. Available contexts vary from screen to
     905 *                                        screen. Post edit screen contexts include 'normal', 'side',
     906 *                                        and 'advanced'. Comments screen contexts include 'normal'
     907 *                                        and 'side'. Menus meta boxes (accordion sections) all use
     908 *                                        the 'side' context. Global default is 'advanced'.
     909 * @param string           $priority      Optional. The priority within the context where the boxes
     910 *                                        should show ('high', 'low'). Default 'default'.
     911 * @param array            $callback_args Optional. Data that should be set as the $args property
     912 *                                        of the box array (which is the second parameter passed
     913 *                                        to your callback). Default null.
     914 */
     915function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
     916        if ( is_array( $screen ) ) {
     917                foreach ( $screen as $screen_single ) {
     918                        add_meta_box_single( $id, $title, $callback, $screen_single, $context, $priority, $callback_args );
     919                }
     920        } else {
     921                add_meta_box_single( $id, $title, $callback, $screen, $context, $priority, $callback_args );
     922        }
     923}
     924/**
     925 * Add a meta box to an edit form.
     926 *
     927 * @since 2.5.0
     928 *
     929 * @param string           $id            String for use in the 'id' attribute of tags.
     930 * @param string           $title         Title of the meta box.
     931 * @param callback         $callback      Function that fills the box with the desired content.
     932 *                                        The function should echo its output.
    902933 * @param string|WP_Screen $screen        Optional. The screen on which to show the box (like a post
    903934 *                                        type, 'link', or 'comment'). Default is the current screen.
    904935 * @param string           $context       Optional. The context within the screen where the boxes
     
    913944 *                                        of the box array (which is the second parameter passed
    914945 *                                        to your callback). Default null.
    915946 */
    916 function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
     947function add_meta_box_single( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
    917948        global $wp_meta_boxes;
    918949
    919950        if ( empty( $screen ) )