Make WordPress Core

Ticket #26089: 26089.3.diff

File 26089.3.diff, 9.8 KB (added by kpdesign, 11 years ago)

First pass on 26089.2.diff

  • src/wp-admin/includes/template.php

     
    8080                        $name = 'tax_input['.$taxonomy.']';
    8181
    8282                $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
     83                /** This filter is documented in wp-includes/category-template.php */
    8384                $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>';
    8485        }
    8586
     
    143144                'taxonomy' => 'category',
    144145                'checked_ontop' => true
    145146        );
     147        /**
     148         * Filter the default arguments for the taxonomy terms checklist.
     149         *
     150         * @since 3.4.0
     151         *
     152         * @param array $args {
     153         *     The args for wp_terms checklist.
     154         *
     155         *     @type bool       $descendants_and_self Whether to display only taxonomies that
     156         *                                            apply to this post and its children, or all
     157         *                                            taxonomies. Default false.
     158         *     @type bool|array $selected_cats        Whether to display selected taxonomies, or an
     159         *                                            array of registered taxonomy IDs assigned to the
     160         *                                            post. Default false.
     161         *     @type bool|array $popular_cats         Whether to display top 10 taxonomies, or an
     162         *                                            array of taxonomies specifying which should be
     163         *                                            shown. Default false.
     164         *     @type object     $walker               Walker class to render the list.
     165         *     @type string     $taxonomy             The taxonomy to return. Default 'category'.
     166         *                                            Any registered taxonomy can be returned.
     167         *     @type bool       $checked_ontop        Whether to display checked taxonomies at
     168         *                                            the top of the terms list. Default true.
     169         * }
     170         *
     171         * @param int   $post_id The post ID.
     172         */
    146173        $args = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
    147174
    148175        extract( wp_parse_args($args, $defaults), EXTR_SKIP );
     
    236263                <li id="<?php echo $id; ?>" class="popular-category">
    237264                        <label class="selectit">
    238265                        <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php disabled( ! current_user_can( $tax->cap->assign_terms ) ); ?> />
    239                                 <?php echo esc_html( apply_filters( 'the_category', $term->name ) ); ?>
     266                                <?php /** This filter is documented in wp-includes/category-template.php */
     267                                echo esc_html( apply_filters( 'the_category', $term->name ) ); ?>
    240268                        </label>
    241269                </li>
    242270
     
    271299
    272300        foreach ( $categories as $category ) {
    273301                $cat_id = $category->term_id;
     302                /** This filter is documented in wp-includes/category-template.php */
    274303                $name = esc_html( apply_filters( 'the_category', $category->name ) );
    275304                $checked = in_array( $cat_id, $checked_categories ) ? ' checked="checked"' : '';
    276305                echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', $checked, '/> ', $name, "</label></li>";
     
    292321
    293322        $title = esc_textarea( trim( $post->post_title ) );
    294323
     324        /** This filter is documented in wp-admin/edit-tag-form.php */
    295325        echo '
    296326<div class="hidden" id="inline_' . $post->ID . '">
    297327        <div class="post_title">' . $title . '</div>
    298         <div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
     328        <div class="post_name">' . apply_filters( 'editable_slug', $post->post_name ) . '</div>
    299329        <div class="post_author">' . $post->post_author . '</div>
    300330        <div class="comment_status">' . esc_html( $post->comment_status ) . '</div>
    301331        <div class="ping_status">' . esc_html( $post->ping_status ) . '</div>
     
    349379 * @param unknown_type $mode
    350380 */
    351381function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', $table_row = true) {
    352         // allow plugin to replace the popup content
    353         $content = apply_filters( 'wp_comment_reply', '', array('position' => $position, 'checkbox' => $checkbox, 'mode' => $mode) );
     382        /**
     383         * Filter the content of the comment reply table row.
     384         *
     385         * @since 2.7.0
     386         *
     387         * @param string $content The table row content.
     388         * @param array  $args    An array of default args.
     389         */
     390        $content = apply_filters( 'wp_comment_reply', '', array( 'position' => $position, 'checkbox' => $checkbox, 'mode' => $mode ) );
    354391
    355392        if ( ! empty($content) ) {
    356393                echo $content;
     
    556593function meta_form( $post = null ) {
    557594        global $wpdb;
    558595        $post = get_post( $post );
     596        /**
     597         * Filter the total custom fields allowed in the Custom Fields meta box.
     598         *
     599         * @since 2.1.0
     600         *
     601         * @param int $limit Number of custom fields allowed. Default 30.
     602         */
    559603        $limit = (int) apply_filters( 'postmeta_form_limit', 30 );
    560604        $keys = $wpdb->get_col( "
    561605                SELECT meta_key
     
    776820 * @param string $action The action attribute for the form.
    777821 */
    778822function wp_import_upload_form( $action ) {
     823        /**
     824         * Filter the maximum allowed upload size for import files.
     825         *
     826         * @since 2.3.0
     827         *
     828         * @param int $max_upload_size Allowed upload size. Default 1 MB.
     829         */
    779830        $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
    780831        $size = size_format( $bytes );
    781832        $upload_dir = wp_upload_dir();
     
    14261477//]]>
    14271478</script>
    14281479<?php
    1429 do_action('admin_enqueue_scripts', $hook_suffix);
    1430 do_action("admin_print_styles-$hook_suffix");
    1431 do_action('admin_print_styles');
    1432 do_action("admin_print_scripts-$hook_suffix");
    1433 do_action('admin_print_scripts');
    1434 do_action("admin_head-$hook_suffix");
    1435 do_action('admin_head');
     1480/** This action is documented in wp-admin/admin-header.php */
     1481do_action( 'admin_enqueue_scripts', $hook_suffix );
     1482/** This action is documented in wp-admin/admin-header.php */
     1483do_action( "admin_print_styles-$hook_suffix" );
     1484/** This action is documented in wp-admin/admin-header.php */
     1485do_action( 'admin_print_styles' );
     1486/** This action is documented in wp-admin/admin-header.php */
     1487do_action( "admin_print_scripts-$hook_suffix" );
     1488/** This action is documented in wp-admin/admin-header.php */
     1489do_action( 'admin_print_scripts' );
     1490/** This action is documented in wp-admin/admin-header.php */
     1491do_action( "admin_head-$hook_suffix" );
     1492/** This action is documented in wp-admin/admin-header.php */
     1493do_action( 'admin_head' );
    14361494
    14371495$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
    14381496
     
    14391497if ( is_rtl() )
    14401498        $admin_body_class .= ' rtl';
    14411499
     1500/** This filter is documented in wp-admin/admin-header.php */
    14421501?>
    14431502</head>
    14441503<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin wp-core-ui no-js iframe <?php echo apply_filters( 'admin_body_class', '' ) . ' ' . $admin_body_class; ?>">
     
    14641523        //We're going to hide any footer output on iframe pages, but run the hooks anyway since they output Javascript or other needed content. ?>
    14651524        <div class="hidden">
    14661525<?php
    1467         do_action('admin_footer', '');
    1468         do_action('admin_print_footer_scripts'); ?>
     1526        /** This action is documented in wp-admin/admin-footer.php */
     1527        do_action( 'admin_footer', '' );
     1528        /** This action is documented in wp-admin/admin-footer.php */
     1529        do_action( 'admin_print_footer_scripts' );
     1530?>
    14691531        </div>
    14701532<script type="text/javascript">if(typeof wpOnload=="function")wpOnload();</script>
    14711533</body>
     
    14921554        if ( is_sticky($post->ID) )
    14931555                $post_states['sticky'] = __('Sticky');
    14941556
     1557        /**
     1558         * Filter the default post states.
     1559         *
     1560         * @since 2.8.0
     1561         *
     1562         * @param string $post_states The current post state. Accepts 'Password protected',
     1563         *                            'Private', 'Draft', 'Pending', 'Sticky'.
     1564         * @param int    $post        The post ID.
     1565         */
    14951566        $post_states = apply_filters( 'display_post_states', $post_states, $post );
    14961567
    14971568        if ( ! empty($post_states) ) {
     
    15231594                        $media_states[] = __( 'Background Image' );
    15241595        }
    15251596
     1597        /**
     1598         * Filter the default media states in the Media Library.
     1599         *
     1600         * @since 3.2.0
     1601         *
     1602         * @param array $media_states An array of media states. Default 'Header Image',
     1603         *                            'Background Image'.
     1604         */
    15261605        $media_states = apply_filters( 'display_media_states', $media_states );
    15271606
    15281607        if ( ! empty( $media_states ) ) {
     
    16921771        if ( $is_IE )
    16931772                @header('X-UA-Compatible: IE=edge');
    16941773
     1774/**
     1775 * Fires when adding the xmlns attribute to the HTML tag in the admin header.
     1776 *
     1777 * @since 2.2.0
     1778 */
    16951779?>
    16961780<!DOCTYPE html>
    16971781<!--[if IE 8]>
    1698 <html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
     1782<html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>>
    16991783<![endif]-->
    17001784<!--[if !(IE 8) ]><!-->
    1701 <html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
     1785<?php /** This action is documented in wp-admin/includes/template.php */ ?>
     1786<html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>>
    17021787<!--<![endif]-->
    17031788<head>
    17041789<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />