X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/61343b82c4f0da4c68e4c6373daafff4a81efdd1..refs/tags/wordpress-3.7:/wp-admin/includes/template.php diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index d8d82a0c..ad42074d 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -24,16 +24,51 @@ class Walker_Category_Checklist extends Walker { var $tree_type = 'category'; var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this + /** + * Starts the list before the elements are added. + * + * @see Walker:start_lvl() + * + * @since 2.5.1 + * + * @param string $output Passed by reference. Used to append additional content. + * @param int $depth Depth of category. Used for tab indentation. + * @param array $args An array of arguments. @see wp_terms_checklist() + */ function start_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat("\t", $depth); $output .= "$indent\n"; } + /** + * Start the element output. + * + * @see Walker::start_el() + * + * @since 2.5.1 + * + * @param string $output Passed by reference. Used to append additional content. + * @param object $category The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. @see wp_terms_checklist() + * @param int $id ID of the current term. + */ function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { extract($args); if ( empty($taxonomy) ) @@ -48,6 +83,18 @@ class Walker_Category_Checklist extends Walker { $output .= "\n
  • " . ''; } + /** + * Ends the element output, if needed. + * + * @see Walker::end_el() + * + * @since 2.5.1 + * + * @param string $output Passed by reference. Used to append additional content. + * @param object $category The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. @see wp_terms_checklist() + */ function end_el( &$output, $category, $depth = 0, $args = array() ) { $output .= "
  • \n"; } @@ -500,12 +547,15 @@ function _list_meta_row( $entry, &$count ) { } /** - * {@internal Missing Short Description}} + * Prints the form in the Custom Fields meta box. * * @since 1.2.0 + * + * @param WP_Post $post Optional. The post being edited. */ -function meta_form() { +function meta_form( $post = null ) { global $wpdb; + $post = get_post( $post ); $limit = (int) apply_filters( 'postmeta_form_limit', 30 ); $keys = $wpdb->get_col( " SELECT meta_key @@ -535,7 +585,7 @@ function meta_form() { ID, $key ) ) continue; echo "\n"; } @@ -695,57 +745,6 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { } } -/** - * {@internal Missing Short Description}} - * - * @since 2.0.0 - * - * @param unknown_type $id - * @return unknown - */ -function the_attachment_links( $id = false ) { - $id = (int) $id; - $post = get_post( $id ); - - if ( $post->post_type != 'attachment' ) - return false; - - $icon = wp_get_attachment_image( $post->ID, 'thumbnail', true ); - $attachment_data = wp_get_attachment_metadata( $id ); - $thumb = isset( $attachment_data['thumb'] ); -?> - - html elements for role selectors * @@ -757,7 +756,7 @@ function wp_dropdown_roles( $selected = false ) { $p = ''; $r = ''; - $editable_roles = get_editable_roles(); + $editable_roles = array_reverse( get_editable_roles() ); foreach ( $editable_roles as $role => $details ) { $name = translate_user_role($details['name'] ); @@ -1072,13 +1071,6 @@ function add_settings_section($id, $title, $callback, $page) { $page = 'reading'; } - if ( !isset($wp_settings_sections) ) - $wp_settings_sections = array(); - if ( !isset($wp_settings_sections[$page]) ) - $wp_settings_sections[$page] = array(); - if ( !isset($wp_settings_sections[$page][$id]) ) - $wp_settings_sections[$page][$id] = array(); - $wp_settings_sections[$page][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback); } @@ -1117,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); } @@ -1143,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 ) { @@ -1178,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 ) { @@ -1219,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, @@ -1256,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 ) @@ -1453,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 "> @@ -1811,7 +1797,7 @@ final class WP_Internal_Pointers { }); setup = function() { - $('').pointer( options ).pointer('open'); + $('').first().pointer( options ).pointer('open'); }; if ( options.position && options.position.defer_loading ) @@ -1905,7 +1891,7 @@ final class WP_Internal_Pointers { $content = '

    ' . __( 'Compare Revisions' ) . '

    '; $content .= '

    ' . __( 'View, compare, and restore other versions of this content on the improved revisions screen.' ) . '

    '; - self::print_js( 'wp360_revisions', '.misc-pub-section.num-revisions', array( + self::print_js( 'wp360_revisions', '.misc-pub-section.misc-pub-revisions', array( 'content' => $content, 'position' => array( 'edge' => is_rtl() ? 'left' : 'right', 'align' => 'center', 'my' => is_rtl() ? 'left' : 'right-14px' ), ) );