Make WordPress Core

Ticket #37231: 37231.diff

File 37231.diff, 1.4 KB (added by jdgrimes, 7 years ago)

Patch from https://github.com/WordPress/WordPress/pull/220

  • wp-admin/includes/template.php

    diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
    index cc590e3..0db2205 100644
    a b function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advan 
    985985 * @param string|WP_Screen $screen  Screen identifier
    986986 * @param string           $context box context
    987987 * @param mixed            $object  gets passed to the box callback function as first parameter
     988 * @param int              $heading_level What level heading to use for the meta box titles.
    988989 * @return int number of meta_boxes
    989990 */
    990 function do_meta_boxes( $screen, $context, $object ) {
     991function do_meta_boxes( $screen, $context, $object, $heading_level = 2 ) {
    991992        global $wp_meta_boxes;
    992993        static $already_sorted = false;
    993994
     995        if ( $heading_level < 1 || $heading_level > 6 ) {
     996                $heading_level = 2;
     997        }
     998
    994999        if ( empty( $screen ) )
    9951000                $screen = get_current_screen();
    9961001        elseif ( is_string( $screen ) )
    function do_meta_boxes( $screen, $context, $object ) { 
    10321037                                                echo '<span class="toggle-indicator" aria-hidden="true"></span>';
    10331038                                                echo '</button>';
    10341039                                        }
    1035                                         echo "<h2 class='hndle'><span>{$box['title']}</span></h2>\n";
     1040                                        echo "<h{$heading_level} class='hndle'><span>{$box['title']}</span></h{$heading_level}>\n";
    10361041                                        echo '<div class="inside">' . "\n";
    10371042                                        call_user_func($box['callback'], $object, $box);
    10381043                                        echo "</div>\n";