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

Fixes #30558
Props DrewAPicture

Built from https://develop.svn.wordpress.org/trunk@30754


git-svn-id: http://core.svn.wordpress.org/trunk@30744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-12-06 21:32:24 +00:00
parent 23707b1ada
commit bdd00b3902
14 changed files with 140 additions and 109 deletions

View File

@ -164,16 +164,19 @@ $admin_body_class .= ' no-customize-support no-svg';
/** /**
* Filter the CSS classes for the body tag in the admin. * Filter the CSS classes for the body tag in the admin.
* *
* This filter differs from the post_class or body_class filters in two important ways: * This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters
* 1. $classes is a space-separated string of class names instead of an array. * in two important ways:
* 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, and no-js cannot be removed. * 1. `$classes` is a space-separated string of class names instead of an array.
* 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui,
* and no-js cannot be removed.
* *
* @since 2.3.0 * @since 2.3.0
* *
* @param string $classes Space-separated string of CSS classes. * @param string $classes Space-separated list of CSS classes.
*/ */
$admin_body_classes = apply_filters( 'admin_body_class', '' );
?> ?>
<body class="wp-admin wp-core-ui no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>"> <body class="wp-admin wp-core-ui no-js <?php echo $admin_body_classes . ' ' . $admin_body_class; ?>">
<script type="text/javascript"> <script type="text/javascript">
document.body.className = document.body.className.replace('no-js','js'); document.body.className = document.body.className.replace('no-js','js');
</script> </script>

View File

@ -464,8 +464,9 @@ do_action( 'edit_form_top', $post ); ?>
* @param string $text Placeholder text. Default 'Enter title here'. * @param string $text Placeholder text. Default 'Enter title here'.
* @param WP_Post $post Post object. * @param WP_Post $post Post object.
*/ */
$title_placeholder = apply_filters( 'enter_title_here', __( 'Enter title here' ), $post );
?> ?>
<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label> <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
<input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" spellcheck="true" autocomplete="off" /> <input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" spellcheck="true" autocomplete="off" />
</div> </div>
<?php <?php

View File

@ -187,16 +187,18 @@ class WP_Links_List_Table extends WP_List_Table {
?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php ?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php
break; break;
default: default:
/**
* Fires for each registered custom link column.
*
* @since 2.1.0
*
* @param string $column_name Name of the custom column.
* @param int $link_id Link ID.
*/
?> ?>
<td <?php echo $attributes ?>><?php do_action( 'manage_link_custom_column', $column_name, $link->link_id ); ?></td> <td <?php echo $attributes ?>><?php
/**
* Fires for each registered custom link column.
*
* @since 2.1.0
*
* @param string $column_name Name of the custom column.
* @param int $link_id Link ID.
*/
do_action( 'manage_link_custom_column', $column_name, $link->link_id );
?></td>
<?php <?php
break; break;
} }

View File

@ -473,21 +473,19 @@ foreach ( $columns as $column_name => $column_display_name ) {
break; break;
} }
?> ?>
<td <?php echo $attributes ?>> <td <?php echo $attributes ?>><?php
<?php /**
/** * Fires for each custom column in the Media list table.
* Fires for each custom column in the Media list table. *
* * Custom columns are registered using the 'manage_media_columns' filter.
* Custom columns are registered using the 'manage_media_columns' filter. *
* * @since 2.5.0
* @since 2.5.0 *
* * @param string $column_name Name of the custom column.
* @param string $column_name Name of the custom column. * @param int $post_id Attachment ID.
* @param int $post_id Attachment ID. */
*/ do_action( 'manage_media_custom_column', $column_name, $post->ID );
?> ?></td>
<?php do_action( 'manage_media_custom_column', $column_name, $post->ID ); ?>
</td>
<?php <?php
break; break;
} }

View File

@ -391,8 +391,10 @@ function export_wp( $args = array() ) {
$is_sticky = is_sticky( $post->ID ) ? 1 : 0; $is_sticky = is_sticky( $post->ID ) ? 1 : 0;
?> ?>
<item> <item>
<?php /** This filter is documented in wp-includes/feed.php */ ?> <title><?php
<title><?php echo apply_filters( 'the_title_rss', $post->post_title ); ?></title> /** This filter is documented in wp-includes/feed.php */
echo apply_filters( 'the_title_rss', $post->post_title );
?></title>
<link><?php the_permalink_rss() ?></link> <link><?php the_permalink_rss() ?></link>
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate> <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
<dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator> <dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>

View File

@ -1585,8 +1585,11 @@ if ( is_rtl() )
?> ?>
</head> </head>
<?php /** This filter is documented in wp-admin/admin-header.php */ ?> <?php
<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; ?>"> /** This filter is documented in wp-admin/admin-header.php */
$admin_body_classes = apply_filters( 'admin_body_class', '' );
?>
<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; ?>">
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
(function(){ (function(){
@ -1868,19 +1871,23 @@ function _wp_admin_html_begin() {
if ( $is_IE ) if ( $is_IE )
@header('X-UA-Compatible: IE=edge'); @header('X-UA-Compatible: IE=edge');
/**
* Fires inside the HTML tag in the admin header.
*
* @since 2.2.0
*/
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<!--[if IE 8]> <!--[if IE 8]>
<html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>> <html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>" <?php
/**
* Fires inside the HTML tag in the admin header.
*
* @since 2.2.0
*/
do_action( 'admin_xml_ns' );
?> <?php language_attributes(); ?>>
<![endif]--> <![endif]-->
<!--[if !(IE 8) ]><!--> <!--[if !(IE 8) ]><!-->
<?php /** This action is documented in wp-admin/includes/template.php */ ?> <html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php
<html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>> /** This action is documented in wp-admin/includes/template.php */
do_action( 'admin_xml_ns' );
?> <?php language_attributes(); ?>>
<!--<![endif]--> <!--<![endif]-->
<head> <head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />

View File

@ -233,14 +233,14 @@ if ( ! IS_PROFILE_PAGE ) {
<?php } <?php }
} ?> } ?>
</h2> </h2>
<?php <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
/** /**
* Fires inside the your-profile form tag on the user editing screen. * Fires inside the your-profile form tag on the user editing screen.
* *
* @since 3.0.0 * @since 3.0.0
*/ */
?> do_action( 'user_edit_form_tag' );
<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' ); ?>> ?>>
<?php wp_nonce_field('update-user_' . $user_id) ?> <?php wp_nonce_field('update-user_' . $user_id) ?>
<?php if ( $wp_http_referer ) : ?> <?php if ( $wp_http_referer ) : ?>
<input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" /> <input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" />
@ -262,20 +262,20 @@ if ( ! IS_PROFILE_PAGE ) {
<?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) : ?> <?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) : ?>
<tr class="user-admin-color-wrap"> <tr class="user-admin-color-wrap">
<th scope="row"><?php _e('Admin Color Scheme')?></th> <th scope="row"><?php _e('Admin Color Scheme')?></th>
<?php <td><?php
/** /**
* Fires in the 'Admin Color Scheme' section of the user editing screen. * Fires in the 'Admin Color Scheme' section of the user editing screen.
* *
* The section is only enabled if a callback is hooked to the action, * The section is only enabled if a callback is hooked to the action,
* and if there is more than one defined color scheme for the admin. * and if there is more than one defined color scheme for the admin.
* *
* @since 3.0.0 * @since 3.0.0
* @since 3.8.1 Added `$user_id` parameter. * @since 3.8.1 Added `$user_id` parameter.
* *
* @param int $user_id The user ID. * @param int $user_id The user ID.
*/ */
?> do_action( 'admin_color_scheme_picker', $user_id );
<td><?php do_action( 'admin_color_scheme_picker', $user_id ); ?></td> ?></td>
</tr> </tr>
<?php <?php
endif; // $_wp_admin_css_colors endif; // $_wp_admin_css_colors

View File

@ -280,14 +280,14 @@ if ( is_multisite() ) {
$type = 'text'; $type = 'text';
} }
?> ?>
<?php <form action="" method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php
/** /**
* Fires inside the adduser form tag. * Fires inside the adduser form tag.
* *
* @since 3.0.0 * @since 3.0.0
*/ */
?> do_action( 'user_new_form_tag' );
<form action="" method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>> ?>>
<input name="action" type="hidden" value="adduser" /> <input name="action" type="hidden" value="adduser" />
<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?> <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
@ -334,8 +334,10 @@ if ( current_user_can( 'create_users') ) {
echo '<h3 id="create-new-user">' . __( 'Add New User' ) . '</h3>'; echo '<h3 id="create-new-user">' . __( 'Add New User' ) . '</h3>';
?> ?>
<p><?php _e('Create a brand new user and add them to this site.'); ?></p> <p><?php _e('Create a brand new user and add them to this site.'); ?></p>
<?php /** This action is documented in wp-admin/user-new.php */ ?> <form action="" method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php
<form action="" method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>> /** This action is documented in wp-admin/user-new.php */
do_action( 'user_new_form_tag' );
?>>
<input name="action" type="hidden" value="createuser" /> <input name="action" type="hidden" value="createuser" />
<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?> <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
<?php <?php

View File

@ -34,10 +34,14 @@ do_action( 'rss_tag_pre', 'rdf' );
<link><?php bloginfo_rss('url') ?></link> <link><?php bloginfo_rss('url') ?></link>
<description><?php bloginfo_rss('description') ?></description> <description><?php bloginfo_rss('description') ?></description>
<dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc:date> <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc:date>
<?php /** This filter is documented in wp-includes/feed-rss2.php */ ?> <sy:updatePeriod><?php
<sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod> /** This filter is documented in wp-includes/feed-rss2.php */
<?php /** This filter is documented in wp-includes/feed-rss2.php */ ?> echo apply_filters( 'rss_update_period', 'hourly' );
<sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency> ?></sy:updatePeriod>
<sy:updateFrequency><?php
/** This filter is documented in wp-includes/feed-rss2.php */
echo apply_filters( 'rss_update_frequency', '1' );
?></sy:updateFrequency>
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<?php <?php
/** /**

View File

@ -44,10 +44,14 @@ do_action( 'rss_tag_pre', 'rss2-comments' );
<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link> <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
<description><?php bloginfo_rss("description") ?></description> <description><?php bloginfo_rss("description") ?></description>
<lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate> <lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
<?php /** This filter is documented in wp-includes/feed-rss2.php */ ?> <sy:updatePeriod><?php
<sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod> /** This filter is documented in wp-includes/feed-rss2.php */
<?php /** This filter is documented in wp-includes/feed-rss2.php */ ?> echo apply_filters( 'rss_update_period', 'hourly' );
<sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency> ?></sy:updatePeriod>
<sy:updateFrequency><?php
/** This filter is documented in wp-includes/feed-rss2.php */
echo apply_filters( 'rss_update_frequency', '1' );
?></sy:updateFrequency>
<?php <?php
/** /**
* Fires at the end of the RSS2 comment feed header. * Fires at the end of the RSS2 comment feed header.

View File

@ -44,30 +44,32 @@ do_action( 'rss_tag_pre', 'rss2' );
<description><?php bloginfo_rss("description") ?></description> <description><?php bloginfo_rss("description") ?></description>
<lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate> <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
<language><?php bloginfo_rss( 'language' ); ?></language> <language><?php bloginfo_rss( 'language' ); ?></language>
<?php <sy:updatePeriod><?php
$duration = 'hourly'; $duration = 'hourly';
/**
* Filter how often to update the RSS feed. /**
* * Filter how often to update the RSS feed.
* @since 2.1.0 *
* * @since 2.1.0
* @param string $duration The update period. *
* Default 'hourly'. Accepts 'hourly', 'daily', 'weekly', 'monthly', 'yearly'. * @param string $duration The update period. Accepts 'hourly', 'daily', 'weekly', 'monthly',
*/ * 'yearly'. Default 'hourly'.
?> */
<sy:updatePeriod><?php echo apply_filters( 'rss_update_period', $duration ); ?></sy:updatePeriod> echo apply_filters( 'rss_update_period', $duration );
<?php ?></sy:updatePeriod>
$frequency = '1'; <sy:updateFrequency><?php
/** $frequency = '1';
* Filter the RSS update frequency.
* /**
* @since 2.1.0 * Filter the RSS update frequency.
* *
* @param string $frequency An integer passed as a string representing the frequency * @since 2.1.0
* of RSS updates within the update period. Default '1'. *
*/ * @param string $frequency An integer passed as a string representing the frequency
?> * of RSS updates within the update period. Default '1'.
<sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', $frequency ); ?></sy:updateFrequency> */
echo apply_filters( 'rss_update_frequency', $frequency );
?></sy:updateFrequency>
<?php <?php
/** /**
* Fires at the end of the RSS2 Feed Header. * Fires at the end of the RSS2 Feed Header.

View File

@ -96,7 +96,10 @@ if ( post_password_required($post) ) { // and it doesn't match the cookie
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($_SERVER["REQUEST_URI"]); ?>" /> <input type="hidden" name="redirect_to" value="<?php echo esc_attr($_SERVER["REQUEST_URI"]); ?>" />
<input name="submit" type="submit" tabindex="5" value="<?php esc_attr_e('Say It!' ); ?>" /> <input name="submit" type="submit" tabindex="5" value="<?php esc_attr_e('Say It!' ); ?>" />
</p> </p>
<?php do_action('comment_form', $post->ID); ?> <?php
/** This filter is documented in wp-includes/comment-template.php */
do_action( 'comment_form', $post->ID );
?>
</form> </form>
<?php } else { // comments are closed ?> <?php } else { // comments are closed ?>
<p><?php _e('Sorry, the comment form is closed at this time.'); ?></p> <p><?php _e('Sorry, the comment form is closed at this time.'); ?></p>

View File

@ -91,7 +91,10 @@ _deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3.
<p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php esc_attr_e('Submit Comment'); ?>" /> <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php esc_attr_e('Submit Comment'); ?>" />
<?php comment_id_fields(); ?> <?php comment_id_fields(); ?>
</p> </p>
<?php do_action('comment_form', $post->ID); ?> <?php
/** This filter is documented in wp-includes/comment-template.php */
do_action( 'comment_form', $post->ID );
?>
</form> </form>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.1-beta2-30753'; $wp_version = '4.1-beta2-30754';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.