WordPress.org

Make WordPress Core

Ticket #25070: 25070.2.diff

File 25070.2.diff, 1.6 KB (added by MZAWeb, 5 years ago)
  • wp-admin/includes/template.php

    diff --git wp-admin/includes/template.php wp-admin/includes/template.php
    index eba7627..7db8095 100644
    function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advan 
    870870}
    871871
    872872/**
    873  * Meta-Box template function
     873 * Meta-Box template function for multiple styles
     874 *
     875 * @param string|object $screen Screen identifier
     876 * @param string $context box context
     877 * @param mixed $object gets passed to the box callback function as first parameter
     878 * @return int number of meta_boxes
     879 */
     880function do_meta_boxes( $screen, $context, $object ) {
     881
     882        $style = apply_filters( 'meta_boxes_style', 'boxes', $screen, $context, $object );
     883
     884        switch ( $style ) {
     885
     886                case 'boxes':
     887                        $i = render_meta_boxes( $screen, $context, $object );
     888                        break;
     889
     890                case 'accordion':
     891                        $i = do_accordion_sections( $screen, $context, $object );
     892                        break;
     893
     894                default:
     895                        $i = apply_filters( 'render_meta_boxes_' . $style, 0, $screen, $context, $object );
     896
     897        }
     898
     899        return $i;
     900}
     901
     902/**
     903 * Meta-Box template function for the standard style
    874904 *
    875905 * @since 2.5.0
    876906 *
    function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advan 
    879909 * @param mixed $object gets passed to the box callback function as first parameter
    880910 * @return int number of meta_boxes
    881911 */
    882 function do_meta_boxes( $screen, $context, $object ) {
     912function render_meta_boxes( $screen, $context, $object ) {
    883913        global $wp_meta_boxes;
    884914        static $already_sorted = false;
    885915
    function do_meta_boxes( $screen, $context, $object ) { 
    933963        echo "</div>";
    934964
    935965        return $i;
    936 
    937966}
    938967
    939968/**