Make WordPress Core

Changeset 30754


Ignore:
Timestamp:
12/06/2014 09:31:41 PM (10 years ago)
Author:
johnbillion
Message:

Improve various hook and filter docs so they are correctly parsed for the code reference.

Fixes #30558
Props DrewAPicture

Location:
trunk/src
Files:
13 edited

Legend:

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

    r30535 r30754  
    165165 * Filter the CSS classes for the body tag in the admin.
    166166 *
    167  * This filter differs from the post_class or body_class filters in two important ways:
    168  * 1. $classes is a space-separated string of class names instead of an array.
    169  * 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, and no-js cannot be removed.
     167 * This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters
     168 * in two important ways:
     169 * 1. `$classes` is a space-separated string of class names instead of an array.
     170 * 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui,
     171 *    and no-js cannot be removed.
    170172 *
    171173 * @since 2.3.0
    172174 *
    173  * @param string $classes Space-separated string of CSS classes.
    174  */
    175 ?>
    176 <body class="wp-admin wp-core-ui no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>">
     175 * @param string $classes Space-separated list of CSS classes.
     176 */
     177$admin_body_classes = apply_filters( 'admin_body_class', '' );
     178?>
     179<body class="wp-admin wp-core-ui no-js <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>">
    177180<script type="text/javascript">
    178181    document.body.className = document.body.className.replace('no-js','js');
  • trunk/src/wp-admin/edit-form-advanced.php

    r30705 r30754  
    465465     * @param WP_Post $post Post object.
    466466     */
     467    $title_placeholder = apply_filters( 'enter_title_here', __( 'Enter title here' ), $post );
    467468    ?>
    468     <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
     469    <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
    469470    <input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" spellcheck="true" autocomplete="off" />
    470471</div>
  • trunk/src/wp-admin/includes/class-wp-links-list-table.php

    r29871 r30754  
    188188                        break;
    189189                    default:
    190                         /**
    191                          * Fires for each registered custom link column.
    192                          *
    193                          * @since 2.1.0
    194                          *
    195                          * @param string $column_name Name of the custom column.
    196                          * @param int    $link_id     Link ID.
    197                          */
    198190                        ?>
    199                         <td <?php echo $attributes ?>><?php do_action( 'manage_link_custom_column', $column_name, $link->link_id ); ?></td>
     191                        <td <?php echo $attributes ?>><?php
     192                            /**
     193                             * Fires for each registered custom link column.
     194                             *
     195                             * @since 2.1.0
     196                             *
     197                             * @param string $column_name Name of the custom column.
     198                             * @param int    $link_id     Link ID.
     199                             */
     200                            do_action( 'manage_link_custom_column', $column_name, $link->link_id );
     201                        ?></td>
    200202                        <?php
    201203                        break;
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r30679 r30754  
    474474        }
    475475?>
    476         <td <?php echo $attributes ?>>
    477             <?php
    478                 /**
    479                  * Fires for each custom column in the Media list table.
    480                  *
    481                  * Custom columns are registered using the 'manage_media_columns' filter.
    482                  *
    483                  * @since 2.5.0
    484                  *
    485                  * @param string $column_name Name of the custom column.
    486                  * @param int    $post_id     Attachment ID.
    487                  */
    488             ?>
    489             <?php do_action( 'manage_media_custom_column', $column_name, $post->ID ); ?>
    490         </td>
     476        <td <?php echo $attributes ?>><?php
     477            /**
     478             * Fires for each custom column in the Media list table.
     479             *
     480             * Custom columns are registered using the 'manage_media_columns' filter.
     481             *
     482             * @since 2.5.0
     483             *
     484             * @param string $column_name Name of the custom column.
     485             * @param int    $post_id     Attachment ID.
     486             */
     487            do_action( 'manage_media_custom_column', $column_name, $post->ID );
     488        ?></td>
    491489<?php
    492490        break;
  • trunk/src/wp-admin/includes/export.php

    r30155 r30754  
    392392?>
    393393    <item>
    394         <?php /** This filter is documented in wp-includes/feed.php */ ?>
    395         <title><?php echo apply_filters( 'the_title_rss', $post->post_title ); ?></title>
     394        <title><?php
     395            /** This filter is documented in wp-includes/feed.php */
     396            echo apply_filters( 'the_title_rss', $post->post_title );
     397        ?></title>
    396398        <link><?php the_permalink_rss() ?></link>
    397399        <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
  • trunk/src/wp-admin/includes/template.php

    r30730 r30754  
    15861586?>
    15871587</head>
    1588 <?php /** This filter is documented in wp-admin/admin-header.php */ ?>
    1589 <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; ?>">
     1588<?php
     1589/** This filter is documented in wp-admin/admin-header.php */
     1590$admin_body_classes = apply_filters( 'admin_body_class', '' );
     1591?>
     1592<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>">
    15901593<script type="text/javascript">
    15911594//<![CDATA[
     
    18691872        @header('X-UA-Compatible: IE=edge');
    18701873
    1871 /**
    1872  * Fires inside the HTML tag in the admin header.
    1873  *
    1874  * @since 2.2.0
    1875  */
    18761874?>
    18771875<!DOCTYPE html>
    18781876<!--[if IE 8]>
    1879 <html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>>
     1877<html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php
     1878    /**
     1879     * Fires inside the HTML tag in the admin header.
     1880     *
     1881     * @since 2.2.0
     1882     */
     1883    do_action( 'admin_xml_ns' );
     1884?> <?php language_attributes(); ?>>
    18801885<![endif]-->
    18811886<!--[if !(IE 8) ]><!-->
    1882 <?php /** This action is documented in wp-admin/includes/template.php */ ?>
    1883 <html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>>
     1887<html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php
     1888    /** This action is documented in wp-admin/includes/template.php */
     1889    do_action( 'admin_xml_ns' );
     1890?> <?php language_attributes(); ?>>
    18841891<!--<![endif]-->
    18851892<head>
  • trunk/src/wp-admin/user-edit.php

    r30705 r30754  
    234234} ?>
    235235</h2>
    236 <?php
    237 /**
    238  * Fires inside the your-profile form tag on the user editing screen.
    239  *
    240  * @since 3.0.0
    241  */
    242 ?>
    243 <form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate"<?php do_action( 'user_edit_form_tag' ); ?>>
     236<form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate"<?php
     237    /**
     238    * Fires inside the your-profile form tag on the user editing screen.
     239    *
     240    * @since 3.0.0
     241    */
     242    do_action( 'user_edit_form_tag' );
     243?>>
    244244<?php wp_nonce_field('update-user_' . $user_id) ?>
    245245<?php if ( $wp_http_referer ) : ?>
     
    263263<tr class="user-admin-color-wrap">
    264264<th scope="row"><?php _e('Admin Color Scheme')?></th>
    265 <?php
    266 /**
    267  * Fires in the 'Admin Color Scheme' section of the user editing screen.
    268  *
    269  * The section is only enabled if a callback is hooked to the action,
    270  * and if there is more than one defined color scheme for the admin.
    271  *
    272  * @since 3.0.0
    273  * @since 3.8.1 Added `$user_id` parameter.
    274  *
    275  * @param int $user_id The user ID.
    276  */
    277 ?>
    278 <td><?php do_action( 'admin_color_scheme_picker', $user_id ); ?></td>
     265<td><?php
     266    /**
     267    * Fires in the 'Admin Color Scheme' section of the user editing screen.
     268    *
     269    * The section is only enabled if a callback is hooked to the action,
     270    * and if there is more than one defined color scheme for the admin.
     271    *
     272    * @since 3.0.0
     273    * @since 3.8.1 Added `$user_id` parameter.
     274    *
     275    * @param int $user_id The user ID.
     276    */
     277    do_action( 'admin_color_scheme_picker', $user_id );
     278?></td>
    279279</tr>
    280280<?php
  • trunk/src/wp-admin/user-new.php

    r30356 r30754  
    281281    }
    282282?>
    283 <?php
    284 /**
    285  * Fires inside the adduser form tag.
    286  *
    287  * @since 3.0.0
    288  */
    289 ?>
    290 <form action="" method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>>
     283<form action="" method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php
     284    /**
     285    * Fires inside the adduser form tag.
     286    *
     287    * @since 3.0.0
     288    */
     289    do_action( 'user_new_form_tag' );
     290?>>
    291291<input name="action" type="hidden" value="adduser" />
    292292<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
     
    335335?>
    336336<p><?php _e('Create a brand new user and add them to this site.'); ?></p>
    337 <?php /** This action is documented in wp-admin/user-new.php */ ?>
    338 <form action="" method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>>
     337<form action="" method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php
     338    /** This action is documented in wp-admin/user-new.php */
     339    do_action( 'user_new_form_tag' );
     340?>>
    339341<input name="action" type="hidden" value="createuser" />
    340342<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
  • trunk/src/wp-includes/feed-rdf.php

    r29014 r30754  
    3535    <description><?php bloginfo_rss('description') ?></description>
    3636    <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc:date>
    37     <?php /** This filter is documented in wp-includes/feed-rss2.php */ ?>
    38     <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
    39     <?php /** This filter is documented in wp-includes/feed-rss2.php */ ?>
    40     <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
     37    <sy:updatePeriod><?php
     38        /** This filter is documented in wp-includes/feed-rss2.php */
     39        echo apply_filters( 'rss_update_period', 'hourly' );
     40    ?></sy:updatePeriod>
     41    <sy:updateFrequency><?php
     42        /** This filter is documented in wp-includes/feed-rss2.php */
     43        echo apply_filters( 'rss_update_frequency', '1' );
     44    ?></sy:updateFrequency>
    4145    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    4246    <?php
  • trunk/src/wp-includes/feed-rss2-comments.php

    r29014 r30754  
    4545    <description><?php bloginfo_rss("description") ?></description>
    4646    <lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
    47     <?php /** This filter is documented in wp-includes/feed-rss2.php */ ?>
    48     <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
    49     <?php /** This filter is documented in wp-includes/feed-rss2.php */ ?>
    50     <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
     47    <sy:updatePeriod><?php
     48        /** This filter is documented in wp-includes/feed-rss2.php */
     49        echo apply_filters( 'rss_update_period', 'hourly' );
     50    ?></sy:updatePeriod>
     51    <sy:updateFrequency><?php
     52        /** This filter is documented in wp-includes/feed-rss2.php */
     53        echo apply_filters( 'rss_update_frequency', '1' );
     54    ?></sy:updateFrequency>
    5155    <?php
    5256    /**
  • trunk/src/wp-includes/feed-rss2.php

    r30538 r30754  
    4545    <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
    4646    <language><?php bloginfo_rss( 'language' ); ?></language>
    47     <?php
    48     $duration = 'hourly';
    49     /**
    50      * Filter how often to update the RSS feed.
    51      *
    52      * @since 2.1.0
    53      *
    54      * @param string $duration The update period.
    55      *                         Default 'hourly'. Accepts 'hourly', 'daily', 'weekly', 'monthly', 'yearly'.
    56      */
    57     ?>
    58     <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', $duration ); ?></sy:updatePeriod>
    59     <?php
    60     $frequency = '1';
    61     /**
    62      * Filter the RSS update frequency.
    63      *
    64      * @since 2.1.0
    65      *
    66      * @param string $frequency An integer passed as a string representing the frequency
    67      *                          of RSS updates within the update period. Default '1'.
    68      */
    69     ?>
    70     <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', $frequency ); ?></sy:updateFrequency>
     47    <sy:updatePeriod><?php
     48        $duration = 'hourly';
     49
     50        /**
     51         * Filter how often to update the RSS feed.
     52         *
     53         * @since 2.1.0
     54         *
     55         * @param string $duration The update period. Accepts 'hourly', 'daily', 'weekly', 'monthly',
     56         *                         'yearly'. Default 'hourly'.
     57         */
     58        echo apply_filters( 'rss_update_period', $duration );
     59    ?></sy:updatePeriod>
     60    <sy:updateFrequency><?php
     61        $frequency = '1';
     62
     63        /**
     64         * Filter the RSS update frequency.
     65         *
     66         * @since 2.1.0
     67         *
     68         * @param string $frequency An integer passed as a string representing the frequency
     69         *                          of RSS updates within the update period. Default '1'.
     70         */
     71        echo apply_filters( 'rss_update_frequency', $frequency );
     72    ?></sy:updateFrequency>
    7173    <?php
    7274    /**
  • trunk/src/wp-includes/theme-compat/comments-popup.php

    r28381 r30754  
    9797      <input name="submit" type="submit" tabindex="5" value="<?php esc_attr_e('Say It!' ); ?>" />
    9898    </p>
    99     <?php do_action('comment_form', $post->ID); ?>
     99    <?php
     100    /** This filter is documented in wp-includes/comment-template.php */
     101    do_action( 'comment_form', $post->ID );
     102    ?>
    100103</form>
    101104<?php } else { // comments are closed ?>
  • trunk/src/wp-includes/theme-compat/comments.php

    r25672 r30754  
    9292<?php comment_id_fields(); ?>
    9393</p>
    94 <?php do_action('comment_form', $post->ID); ?>
     94<?php
     95/** This filter is documented in wp-includes/comment-template.php */
     96do_action( 'comment_form', $post->ID );
     97?>
    9598
    9699</form>
Note: See TracChangeset for help on using the changeset viewer.