' . "\n";
if ( 'dashboard_browser_nag' != $box['id'] )
@@ -968,6 +965,79 @@ function remove_meta_box($id, $screen, $context) {
$wp_meta_boxes[$page][$context][$priority][$id] = false;
}
+/**
+ * Meta Box Accordion Template Function
+ *
+ * Largely made up of abstracted code from {@link do_meta_boxes()}, this
+ * function serves to build meta boxes as list items for display as
+ * a collapsible accordion.
+ *
+ * @since 3.6.0
+ *
+ * @uses global $wp_meta_boxes Used to retrieve registered meta boxes.
+ *
+ * @param string|object $screen The screen identifier.
+ * @param string $context The meta box context.
+ * @param mixed $object gets passed to the section callback function as first parameter.
+ * @return int number of meta boxes as accordion sections.
+ */
+function do_accordion_sections( $screen, $context, $object ) {
+ global $wp_meta_boxes;
+
+ wp_enqueue_script( 'accordion' );
+
+ if ( empty( $screen ) )
+ $screen = get_current_screen();
+ elseif ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
+
+ $page = $screen->id;
+
+ $hidden = get_hidden_meta_boxes( $screen );
+ ?>
+
+ $id, 'title' => $title, 'callback' => $callback);
}
@@ -1046,13 +1109,6 @@ function add_settings_field($id, $title, $callback, $page, $section = 'default',
$page = 'reading';
}
- if ( !isset($wp_settings_fields) )
- $wp_settings_fields = array();
- if ( !isset($wp_settings_fields[$page]) )
- $wp_settings_fields[$page] = array();
- if ( !isset($wp_settings_fields[$page][$section]) )
- $wp_settings_fields[$page][$section] = array();
-
$wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args);
}
@@ -1072,7 +1128,7 @@ function add_settings_field($id, $title, $callback, $page, $section = 'default',
function do_settings_sections( $page ) {
global $wp_settings_sections, $wp_settings_fields;
- if ( ! isset( $wp_settings_sections ) || !isset( $wp_settings_sections[$page] ) )
+ if ( ! isset( $wp_settings_sections[$page] ) )
return;
foreach ( (array) $wp_settings_sections[$page] as $section ) {
@@ -1107,7 +1163,7 @@ function do_settings_sections( $page ) {
function do_settings_fields($page, $section) {
global $wp_settings_fields;
- if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) )
+ if ( ! isset( $wp_settings_fields[$page][$section] ) )
return;
foreach ( (array) $wp_settings_fields[$page][$section] as $field ) {
@@ -1148,9 +1204,6 @@ function do_settings_fields($page, $section) {
function add_settings_error( $setting, $code, $message, $type = 'error' ) {
global $wp_settings_errors;
- if ( !isset($wp_settings_errors) )
- $wp_settings_errors = array();
-
$new_error = array(
'setting' => $setting,
'code' => $code,
@@ -1185,7 +1238,7 @@ function add_settings_error( $setting, $code, $message, $type = 'error' ) {
function get_settings_errors( $setting = '', $sanitize = false ) {
global $wp_settings_errors;
- // If $sanitize is true, manually re-run the sanitizisation for this option
+ // If $sanitize is true, manually re-run the sanitization for this option
// This allows the $sanitize_callback from register_setting() to run, adding
// any settings errors you want to show by default.
if ( $sanitize )
@@ -1334,7 +1387,7 @@ function _draft_or_post_title( $post = 0 ) {
*
*/
function _admin_search_query() {
- echo isset($_REQUEST['s']) ? esc_attr( stripslashes( $_REQUEST['s'] ) ) : '';
+ echo isset($_REQUEST['s']) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';
}
/**
@@ -1363,12 +1416,7 @@ wp_enqueue_style( 'colors' );
//',
- 'uid': 'ID; ?>',
- 'time':''
- },
- ajaxurl = '',
+var ajaxurl = '',
pagenow = 'id; ?>',
typenow = 'post_type; ?>',
adminpage = '',
@@ -1387,6 +1435,10 @@ do_action("admin_head-$hook_suffix");
do_action('admin_head');
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
+
+if ( is_rtl() )
+ $admin_body_class .= ' rtl';
+
?>
class="wp-admin wp-core-ui no-js iframe ">
@@ -1440,7 +1492,7 @@ function _post_states($post) {
if ( is_sticky($post->ID) )
$post_states['sticky'] = __('Sticky');
- $post_states = apply_filters( 'display_post_states', $post_states );
+ $post_states = apply_filters( 'display_post_states', $post_states, $post );
if ( ! empty($post_states) ) {
$state_count = count($post_states);
@@ -1453,8 +1505,6 @@ function _post_states($post) {
}
}
- if ( get_post_format( $post->ID ) )
- echo ' -
' . get_post_format_string( get_post_format( $post->ID ) ) . '';
}
function _media_states( $post ) {
@@ -1635,7 +1685,13 @@ function get_submit_button( $text = null, $type = 'primary large', $name = 'subm
}
function _wp_admin_html_begin() {
+ global $is_IE;
+
$admin_html_class = ( is_admin_bar_showing() ) ? 'wp-toolbar' : '';
+
+ if ( $is_IE )
+ @header('X-UA-Compatible: IE=edge');
+
?>