899 | | // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose |
900 | | if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) { |
901 | | foreach ( $sorted as $box_context => $ids ) { |
902 | | foreach ( explode(',', $ids ) as $id ) { |
903 | | if ( $id && 'dashboard_browser_nag' !== $id ) |
904 | | add_meta_box( $id, null, null, $screen, $box_context, 'sorted' ); |
| 905 | if ( ! $accordion ) { |
| 906 | // Grab the ones the user has manually sorted. |
| 907 | // Pull them out of their previous context/priority and into the one the user chose. |
| 908 | if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) { |
| 909 | foreach ( $sorted as $box_context => $ids ) { |
| 910 | foreach ( explode(',', $ids ) as $id ) { |
| 911 | if ( $id && 'dashboard_browser_nag' !== $id ) |
| 912 | add_meta_box( $id, null, null, $screen, $box_context, 'sorted' ); |
| 913 | } |
920 | | echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n"; |
921 | | if ( 'dashboard_browser_nag' != $box['id'] ) |
922 | | echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>'; |
923 | | echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n"; |
924 | | echo '<div class="inside">' . "\n"; |
925 | | call_user_func($box['callback'], $object, $box); |
926 | | echo "</div>\n"; |
927 | | echo "</div>\n"; |
| 929 | if ( ! $accordion ) { |
| 930 | ?> |
| 931 | <div id="<?php echo esc_attr( $box['id'] ); ?>" class="postbox <?php echo postbox_classes( $box['id'], $page ) . $hidden_class; ?>"> |
| 932 | <?php |
| 933 | if ( 'dashboard_browser_nag' != $box['id'] ) |
| 934 | echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>'; |
| 935 | ?> |
| 936 | <h3 class="hndle"><span><?php echo $box['title']; ?></span></h3> |
| 937 | <div class="inside"> |
| 938 | <?php call_user_func( $box['callback'], $object, $box ); ?> |
| 939 | </div><!-- .hndle --> |
| 940 | </div><!-- .postbox --> |
| 941 | <?php } else { // Accordion output ?> |
| 942 | <li class="control-section accordion-section <?php echo $hidden_class; ?> <?php echo esc_attr( $box['id'] ); ?>" id="<?php echo esc_attr( $box['id'] ); ?>"> |
| 943 | <h3 class="accordion-section-title hndle" tabindex="0" title="<?php echo esc_attr( $box['title'] ); ?>"><?php echo esc_html( $box['title'] ); ?></h3> |
| 944 | <div class="accordion-section-content <?php postbox_classes( $box['id'], $page ); ?>"> |
| 945 | <div class="inside"> |
| 946 | <?php call_user_func( $box['callback'], $object, $box ); ?> |
| 947 | </div><!-- .inside --> |
| 948 | </div><!-- .accordion-section-content --> |
| 949 | </li><!-- .accordion-section --> |
| 950 | <?php |
| 951 | } |
986 | | global $wp_meta_boxes; |
987 | | |
988 | | if ( empty( $screen ) ) |
989 | | $screen = get_current_screen(); |
990 | | elseif ( is_string( $screen ) ) |
991 | | $screen = convert_to_screen( $screen ); |
992 | | |
993 | | $page = $screen->id; |
994 | | |
995 | | $hidden = get_hidden_meta_boxes( $screen ); |
996 | | ?> |
997 | | <div id="side-sortables" class="accordion-container"> |
998 | | <ul class="outer-border"> |
999 | | <?php |
1000 | | $i = 0; |
1001 | | do { |
1002 | | if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[$page] ) || ! isset( $wp_meta_boxes[$page][$context] ) ) |
1003 | | break; |
1004 | | |
1005 | | foreach ( array( 'high', 'sorted', 'core', 'default', 'low' ) as $priority ) { |
1006 | | if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) { |
1007 | | foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) { |
1008 | | if ( false == $box || ! $box['title'] ) |
1009 | | continue; |
1010 | | $i++; |
1011 | | $hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : ''; |
1012 | | ?> |
1013 | | <li class="control-section accordion-section <?php echo $hidden_class; ?> <?php echo esc_attr( $box['id'] ); ?>" id="<?php echo esc_attr( $box['id'] ); ?>"> |
1014 | | <h3 class="accordion-section-title hndle" tabindex="0" title="<?php echo esc_attr( $box['title'] ); ?>"><?php echo esc_html( $box['title'] ); ?></h3> |
1015 | | <div class="accordion-section-content <?php postbox_classes( $box['id'], $page ); ?>"> |
1016 | | <div class="inside"> |
1017 | | <?php call_user_func( $box['callback'], $object, $box ); ?> |
1018 | | </div><!-- .inside --> |
1019 | | </div><!-- .accordion-section-content --> |
1020 | | </li><!-- .accordion-section --> |
1021 | | <?php |
1022 | | } |
1023 | | } |
1024 | | } |
1025 | | } while(0); |
1026 | | ?> |
1027 | | </ul><!-- .outer-border --> |
1028 | | </div><!-- .accordion-container --> |
1029 | | <?php |
1030 | | return $i; |
| 1015 | do_meta_boxes( $screen, 'side', $object, true ); |