Make WordPress Core


Ignore:
Timestamp:
02/23/2014 10:43:44 PM (13 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-admin/includes/template.php.

Props shelob9 for the initial patch. Props kpdesign.
Fixes #26089.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r27194 r27237  
    8181
    8282                $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
    83                 $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>';
     83
     84                /** This filter is documented in wp-includes/category-template.php */
     85                $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>';
    8486        }
    8587
     
    144146                'checked_ontop' => true
    145147        );
     148
     149        /**
     150         * Filter the taxonomy terms checklist arguments.
     151         *
     152         * @since 3.4.0
     153         *
     154         * @see wp_terms_checklist()
     155         *
     156         * @param array $args    An array of arguments.
     157         * @param int   $post_id The post ID.
     158         */
    146159        $args = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
    147160
     
    236249                <li id="<?php echo $id; ?>" class="popular-category">
    237250                        <label class="selectit">
    238                         <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 ) ); ?>
     251                                <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 ) ); ?> />
     252                                <?php
     253                                /** This filter is documented in wp-includes/category-template.php */
     254                                echo esc_html( apply_filters( 'the_category', $term->name ) );
     255                                ?>
    240256                        </label>
    241257                </li>
     
    272288        foreach ( $categories as $category ) {
    273289                $cat_id = $category->term_id;
     290
     291                /** This filter is documented in wp-includes/category-template.php */
    274292                $name = esc_html( apply_filters( 'the_category', $category->name ) );
    275293                $checked = in_array( $cat_id, $checked_categories ) ? ' checked="checked"' : '';
     
    293311        $title = esc_textarea( trim( $post->post_title ) );
    294312
     313        /** This filter is documented in wp-admin/edit-tag-form.php */
    295314        echo '
    296315<div class="hidden" id="inline_' . $post->ID . '">
    297316        <div class="post_title">' . $title . '</div>
    298         <div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
     317        <div class="post_name">' . apply_filters( 'editable_slug', $post->post_name ) . '</div>
    299318        <div class="post_author">' . $post->post_author . '</div>
    300319        <div class="comment_status">' . esc_html( $post->comment_status ) . '</div>
     
    350369 */
    351370function 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) );
     371
     372        /**
     373         * Filter the in-line comment reply-to form output in the Comments
     374         * list table.
     375         *
     376         * Returning a non-empty value here will short-circuit display
     377         * of the in-line comment-reply form in the Comments list table,
     378         * echoing the returned value instead.
     379         *
     380         * @since 2.7.0
     381         *
     382         * @see wp_comment_reply()
     383         *
     384         * @param string $content The reply-to form content.
     385         * @param array  $args    An array of default args.
     386         */
     387        $content = apply_filters( 'wp_comment_reply', '', array( 'position' => $position, 'checkbox' => $checkbox, 'mode' => $mode ) );
    354388
    355389        if ( ! empty($content) ) {
     
    557591        global $wpdb;
    558592        $post = get_post( $post );
     593
     594        /**
     595         * Filter the number of custom fields to retrieve for the drop-down
     596         * in the Custom Fields meta box.
     597         *
     598         * @since 2.1.0
     599         *
     600         * @param int $limit Number of custom fields to retrieve. Default 30.
     601         */
    559602        $limit = (int) apply_filters( 'postmeta_form_limit', 30 );
    560603        $keys = $wpdb->get_col( "
     
    771814 */
    772815function wp_import_upload_form( $action ) {
     816
     817        /**
     818         * Filter the maximum allowed upload size for import files.
     819         *
     820         * @since 2.3.0
     821         *
     822         * @see wp_max_upload_size()
     823         *
     824         * @param int $max_upload_size Allowed upload size. Default 1 MB.
     825         */
    773826        $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
    774827        $size = size_format( $bytes );
     
    14311484</script>
    14321485<?php
    1433 do_action('admin_enqueue_scripts', $hook_suffix);
    1434 do_action("admin_print_styles-$hook_suffix");
    1435 do_action('admin_print_styles');
    1436 do_action("admin_print_scripts-$hook_suffix");
    1437 do_action('admin_print_scripts');
    1438 do_action("admin_head-$hook_suffix");
    1439 do_action('admin_head');
     1486/** This action is documented in wp-admin/admin-header.php */
     1487do_action( 'admin_enqueue_scripts', $hook_suffix );
     1488
     1489/** This action is documented in wp-admin/admin-header.php */
     1490do_action( "admin_print_styles-$hook_suffix" );
     1491
     1492/** This action is documented in wp-admin/admin-header.php */
     1493do_action( 'admin_print_styles' );
     1494
     1495/** This action is documented in wp-admin/admin-header.php */
     1496do_action( "admin_print_scripts-$hook_suffix" );
     1497
     1498/** This action is documented in wp-admin/admin-header.php */
     1499do_action( 'admin_print_scripts' );
     1500
     1501/** This action is documented in wp-admin/admin-header.php */
     1502do_action( "admin_head-$hook_suffix" );
     1503
     1504/** This action is documented in wp-admin/admin-header.php */
     1505do_action( 'admin_head' );
    14401506
    14411507$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
     
    14461512?>
    14471513</head>
     1514<?php
     1515/** This filter is documented in wp-admin/admin-header.php */
     1516?>
    14481517<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; ?>">
    14491518<script type="text/javascript">
     
    14661535 */
    14671536function iframe_footer() {
    1468         //We're going to hide any footer output on iframe pages, but run the hooks anyway since they output Javascript or other needed content. ?>
     1537        /*
     1538         * We're going to hide any footer output on iFrame pages,
     1539         * but run the hooks anyway since they output Javascript
     1540         * or other needed content.
     1541         */
     1542         ?>
    14691543        <div class="hidden">
    14701544<?php
    1471         do_action('admin_footer', '');
    1472         do_action('admin_print_footer_scripts'); ?>
     1545        /** This action is documented in wp-admin/admin-footer.php */
     1546        do_action( 'admin_footer', '' );
     1547
     1548        /** This action is documented in wp-admin/admin-footer.php */
     1549        do_action( 'admin_print_footer_scripts' );
     1550?>
    14731551        </div>
    14741552<script type="text/javascript">if(typeof wpOnload=="function")wpOnload();</script>
     
    14971575                $post_states['sticky'] = __('Sticky');
    14981576
     1577        /**
     1578         * Filter the default post display states used in the Posts list table.
     1579         *
     1580         * @since 2.8.0
     1581         *
     1582         * @param array $post_states An array of post display states. Values include 'Password protected',
     1583         *                           'Private', 'Draft', 'Pending', and 'Sticky'.
     1584         * @param int   $post        The post ID.
     1585         */
    14991586        $post_states = apply_filters( 'display_post_states', $post_states, $post );
    15001587
     
    15281615        }
    15291616
     1617        /**
     1618         * Filter the default media display states for items in the Media list table.
     1619         *
     1620         * @since 3.2.0
     1621         *
     1622         * @param array $media_states An array of media states. Default 'Header Image',
     1623         *                            'Background Image'.
     1624         */
    15301625        $media_states = apply_filters( 'display_media_states', $media_states );
    15311626
     
    17021797                @header('X-UA-Compatible: IE=edge');
    17031798
     1799/**
     1800 * Fires inside the HTML tag in the admin header.
     1801 *
     1802 * @since 2.2.0
     1803 */
    17041804?>
    17051805<!DOCTYPE html>
    17061806<!--[if IE 8]>
    1707 <html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
     1807<html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>>
    17081808<![endif]-->
    17091809<!--[if !(IE 8) ]><!-->
    1710 <html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
     1810<?php /** This action is documented in wp-admin/includes/template.php */ ?>
     1811<html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>>
    17111812<!--<![endif]-->
    17121813<head>
Note: See TracChangeset for help on using the changeset viewer.