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.
*
* This filter differs from the post_class or body_class filters in two important ways:
* 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.
* This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters
* in two important ways:
* 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
*
* @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">
document.body.className = document.body.className.replace('no-js','js');
</script>

View File

@ -464,8 +464,9 @@ do_action( 'edit_form_top', $post ); ?>
* @param string $text Placeholder text. Default 'Enter title here'.
* @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" />
</div>
<?php

View File

@ -187,6 +187,8 @@ class WP_Links_List_Table extends WP_List_Table {
?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php
break;
default:
?>
<td <?php echo $attributes ?>><?php
/**
* Fires for each registered custom link column.
*
@ -195,8 +197,8 @@ class WP_Links_List_Table extends WP_List_Table {
* @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>
do_action( 'manage_link_custom_column', $column_name, $link->link_id );
?></td>
<?php
break;
}

View File

@ -473,8 +473,7 @@ foreach ( $columns as $column_name => $column_display_name ) {
break;
}
?>
<td <?php echo $attributes ?>>
<?php
<td <?php echo $attributes ?>><?php
/**
* Fires for each custom column in the Media list table.
*
@ -485,9 +484,8 @@ foreach ( $columns as $column_name => $column_display_name ) {
* @param string $column_name Name of the custom column.
* @param int $post_id Attachment ID.
*/
?>
<?php do_action( 'manage_media_custom_column', $column_name, $post->ID ); ?>
</td>
do_action( 'manage_media_custom_column', $column_name, $post->ID );
?></td>
<?php
break;
}

View File

@ -391,8 +391,10 @@ function export_wp( $args = array() ) {
$is_sticky = is_sticky( $post->ID ) ? 1 : 0;
?>
<item>
<?php /** This filter is documented in wp-includes/feed.php */ ?>
<title><?php echo apply_filters( 'the_title_rss', $post->post_title ); ?></title>
<title><?php
/** 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>
<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>

View File

@ -1585,8 +1585,11 @@ if ( is_rtl() )
?>
</head>
<?php /** This filter is documented in wp-admin/admin-header.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; ?>">
<?php
/** 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">
//<![CDATA[
(function(){
@ -1868,19 +1871,23 @@ function _wp_admin_html_begin() {
if ( $is_IE )
@header('X-UA-Compatible: IE=edge');
?>
<!DOCTYPE html>
<!--[if IE 8]>
<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
*/
?>
<!DOCTYPE html>
<!--[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(); ?>>
do_action( 'admin_xml_ns' );
?> <?php language_attributes(); ?>>
<![endif]-->
<!--[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 do_action( 'admin_xml_ns' ); ?> <?php language_attributes(); ?>>
<html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>" <?php
/** This action is documented in wp-admin/includes/template.php */
do_action( 'admin_xml_ns' );
?> <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<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 }
} ?>
</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.
*
* @since 3.0.0
*/
?>
<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' ); ?>>
do_action( 'user_edit_form_tag' );
?>>
<?php wp_nonce_field('update-user_' . $user_id) ?>
<?php if ( $wp_http_referer ) : ?>
<input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" />
@ -262,7 +262,7 @@ if ( ! IS_PROFILE_PAGE ) {
<?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) : ?>
<tr class="user-admin-color-wrap">
<th scope="row"><?php _e('Admin Color Scheme')?></th>
<?php
<td><?php
/**
* Fires in the 'Admin Color Scheme' section of the user editing screen.
*
@ -274,8 +274,8 @@ if ( ! IS_PROFILE_PAGE ) {
*
* @param int $user_id The user ID.
*/
?>
<td><?php do_action( 'admin_color_scheme_picker', $user_id ); ?></td>
do_action( 'admin_color_scheme_picker', $user_id );
?></td>
</tr>
<?php
endif; // $_wp_admin_css_colors

View File

@ -280,14 +280,14 @@ if ( is_multisite() ) {
$type = 'text';
}
?>
<?php
<form action="" method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php
/**
* Fires inside the adduser form tag.
*
* @since 3.0.0
*/
?>
<form action="" method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>>
do_action( 'user_new_form_tag' );
?>>
<input name="action" type="hidden" value="adduser" />
<?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>';
?>
<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 do_action( 'user_new_form_tag' );?>>
<form action="" method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php
/** This action is documented in wp-admin/user-new.php */
do_action( 'user_new_form_tag' );
?>>
<input name="action" type="hidden" value="createuser" />
<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
<?php

View File

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

View File

@ -44,20 +44,22 @@ do_action( 'rss_tag_pre', 'rss2' );
<description><?php bloginfo_rss("description") ?></description>
<lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
<language><?php bloginfo_rss( 'language' ); ?></language>
<?php
<sy:updatePeriod><?php
$duration = 'hourly';
/**
* Filter how often to update the RSS feed.
*
* @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>
<?php
echo apply_filters( 'rss_update_period', $duration );
?></sy:updatePeriod>
<sy:updateFrequency><?php
$frequency = '1';
/**
* Filter the RSS update frequency.
*
@ -66,8 +68,8 @@ do_action( 'rss_tag_pre', 'rss2' );
* @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
/**
* 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 name="submit" type="submit" tabindex="5" value="<?php esc_attr_e('Say It!' ); ?>" />
</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>
<?php } else { // comments are closed ?>
<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'); ?>" />
<?php comment_id_fields(); ?>
</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>

View File

@ -4,7 +4,7 @@
*
* @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.