Spell out duplicate hook locations.

props DrewAPicture.
fixes #25658.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2013-10-24 22:59:20 +00:00
parent 93e54b6646
commit 5361a8abca
39 changed files with 89 additions and 62 deletions

View File

@@ -38,7 +38,7 @@ require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
send_nosniff_header();
nocache_headers();
//duplicate_hook
/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );
$core_actions_get = array(

View File

@@ -23,7 +23,7 @@ require_once(ABSPATH . 'wp-admin/includes/admin.php');
nocache_headers();
//duplicate_hook
/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );
$action = 'admin_post';

View File

@@ -386,7 +386,7 @@ if ( current_theme_supports( 'custom-background', 'default-color' ) )
$thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
set_theme_mod('background_image_thumb', esc_url_raw( $thumbnail[0] ) );
//duplicate_hook
/** This action is documented in wp-admin/custom-header.php */
do_action( 'wp_create_file_in_uploads', $file, $id ); // For replication
$this->updated = true;
}
@@ -412,7 +412,7 @@ if ( current_theme_supports( 'custom-background', 'default-color' ) )
public function wp_set_background_image() {
if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit;
$attachment_id = absint($_POST['attachment_id']);
//duplicate_hook
/** This filter is documented in wp-admin/includes/media.php */
$sizes = array_keys(apply_filters( 'image_size_names_choose', array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size')) ));
$size = 'thumbnail';
if ( in_array( $_POST['size'], $sizes ) )

View File

@@ -712,7 +712,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
if ( ! $image || is_wp_error( $image ) )
wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
//duplicate_hook
/** This filter is documented in wp-admin/custom-header.php */
$image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication
$url = str_replace(basename($url), basename($image), $url);
@@ -854,7 +854,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
if ( ! $cropped || is_wp_error( $cropped ) )
wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
//duplicate_hook
/** This filter is documented in wp-admin/custom-header.php */
$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication
$parent = get_post($attachment_id);
@@ -887,12 +887,18 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
// cleanup
$medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
if ( file_exists( $medium ) ) {
//duplicate_hook
/**
* Filter the path of the file to delete.
*
* @since 2.1.0
*
* @param string $medium Path to the file to delete.
*/
@unlink( apply_filters( 'wp_delete_file', $medium ) );
}
if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) {
//duplicate_hook
/** This filter is documented in wp-admin/custom-header.php */
@unlink( apply_filters( 'wp_delete_file', $original ) );
}

View File

@@ -239,9 +239,9 @@ do_action( 'add_meta_boxes_' . $post_type, $post );
* @param WP_Post $post Post object.
*/
do_action( 'do_meta_boxes', $post_type, 'normal', $post );
//duplicate_hook
/** This action is documented in wp-admin/edit-form-advanced.php */
do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
//duplicate_hook
/** This action is documented in wp-admin/edit-form-advanced.php */
do_action( 'do_meta_boxes', $post_type, 'side', $post );
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );

View File

@@ -33,8 +33,11 @@ add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', null,
do_action('add_meta_boxes', 'link', $link);
do_action('add_meta_boxes_link', $link);
/** This action is documented in wp-admin/edit-form-advanced.php */
do_action('do_meta_boxes', 'link', 'normal', $link);
/** This action is documented in wp-admin/edit-form-advanced.php */
do_action('do_meta_boxes', 'link', 'advanced', $link);
/** This action is documented in wp-admin/edit-form-advanced.php */
do_action('do_meta_boxes', 'link', 'side', $link);
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );

View File

@@ -190,7 +190,7 @@ function wp_ajax_autocomplete_user() {
if ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) )
wp_die( -1 );
//duplicate_hook
/** This filter is documented in wp-admin/user-new.php */
if ( ! is_super_admin() && ! apply_filters( 'autocomplete_users_for_site_admins', false ) )
wp_die( -1 );
@@ -2002,7 +2002,7 @@ function wp_ajax_save_attachment_compat() {
if ( 'attachment' != $post['post_type'] )
wp_send_json_error();
//duplicate_hook
/** This filter is documented in wp-admin/includes/media.php */
$post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
if ( isset( $post['errors'] ) ) {
@@ -2105,7 +2105,7 @@ function wp_ajax_send_attachment_to_editor() {
$html = stripslashes_deep( $_POST['html'] );
}
//duplicate_hook
/** This filter is documented in wp-admin/includes/media.php */
$html = apply_filters( 'media_send_to_editor', $html, $id, $attachment );
wp_send_json_success( $html );
@@ -2146,7 +2146,7 @@ function wp_ajax_send_link_to_editor() {
&& ( 'audio' == $ext_type || 'video' == $ext_type ) )
$type = $ext_type;
//duplicate_hook
/** This filter is documented in wp-admin/includes/media.php */
$html = apply_filters( $type . '_send_to_editor_url', $html, $src, $title );
wp_send_json_success( $html );

View File

@@ -540,8 +540,10 @@ class WP_Posts_List_Table extends WP_List_Table {
$level++;
$find_main_page = (int) $parent->post_parent;
if ( !isset( $parent_name ) )
if ( !isset( $parent_name ) ) {
/** This filter is documented in wp-includes/post-template.php */
$parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID );
}
}
}
}

View File

@@ -142,7 +142,9 @@ function wp_dashboard_setup() {
if ( $update )
update_option( 'dashboard_widget_options', $widget_options );
/** This action is documented in wp-admin/edit-form-advanced.php */
do_action('do_meta_boxes', $screen->id, 'normal', '');
/** This action is documented in wp-admin/edit-form-advanced.php */
do_action('do_meta_boxes', $screen->id, 'side', '');
}

View File

@@ -367,6 +367,7 @@ 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>
<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>

View File

@@ -499,6 +499,7 @@ function wp_restore_image($post_id) {
if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) {
// delete only if it's edited image
if ( preg_match('/-e[0-9]{13}\./', $parts['basename']) ) {
/** This filter is documented in wp-admin/custom-header.php */
$delpath = apply_filters('wp_delete_file', $file);
@unlink($delpath);
}
@@ -522,6 +523,7 @@ function wp_restore_image($post_id) {
if ( defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ) {
// delete only if it's edited image
if ( preg_match('/-e[0-9]{13}-/', $meta['sizes'][$default_size]['file']) ) {
/** This filter is documented in wp-admin/custom-header.php */
$delpath = apply_filters( 'wp_delete_file', path_join($parts['dirname'], $meta['sizes'][$default_size]['file']) );
@unlink($delpath);
}
@@ -722,6 +724,7 @@ function wp_save_image( $post_id ) {
}
if ( $delete ) {
/** This filter is documented in wp-admin/custom-header.php */
$delpath = apply_filters('wp_delete_file', $new_path);
@unlink( $delpath );
}

View File

@@ -677,13 +677,7 @@ function choose_primary_blog() {
<th scope="row" colspan="2" class="th-full">
<?php
$signup_url = network_site_url( 'wp-signup.php' );
/**
* Filter the site signup URL.
*
* @since MU
*
* @param string $signup_url The site signup URL.
*/
/** This filter is documented in wp-login.php */
?>
<a href="<?php echo apply_filters( 'wp_signup_location', $signup_url ); ?>"><?php _e( 'Create a New Site' ); ?></a>
</th>

View File

@@ -308,7 +308,7 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
if ( ! empty( $item->label ) ) {
$title = $item->label;
} elseif ( isset( $item->post_type ) ) {
//duplicate_hook
/** This filter is documented in wp-includes/post-template.php */
$title = apply_filters( 'the_title', $item->post_title, $item->ID );
if ( ! empty( $item->front_or_home ) && _x( 'Home', 'nav menu home label' ) !== $title )
$title = sprintf( _x( 'Home: %s', 'nav menu front page title' ), $title );

View File

@@ -270,6 +270,7 @@ function edit_post( $post_data = null ) {
}
$attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array();
/** This filter is documented in wp-admin/includes/media.php */
$post_data = apply_filters( 'attachment_fields_to_save', $post_data, $attachment_data );
}

View File

@@ -70,7 +70,7 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
*/
$content_from = $compare_from ? apply_filters( "_wp_post_revision_field_$field", $compare_from->$field, $field, $compare_from, 'from' ) : '';
//duplicate_hook
/** This filter is documented in wp-admin/includes/revision.php */
$content_to = apply_filters( "_wp_post_revision_field_$field", $compare_to->$field, $field, $compare_to, 'to' );
$diff = wp_text_diff( $content_from, $content_to, array( 'show_split_view' => true ) );

View File

@@ -28,7 +28,7 @@ get_current_screen()->add_help_tab( array(
'content' => '<p>' . __('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you&#8217;ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.') . '</p>',
) );
//duplicate_hook
/** This filter is documented in wp-admin/options.php */
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
get_current_screen()->add_help_tab( array(
'id' => 'options-postemail',
@@ -131,7 +131,7 @@ do_settings_fields('writing', 'remote_publishing'); // A deprecated section.
</div>
<?php
//duplicate_hook
/** This filter is documented in wp-admin/options.php */
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
?>
<h3 class="title"><?php _e('Post via e-mail') ?></h3>
@@ -168,7 +168,7 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_email_categor
<?php } ?>
<?php
//duplicate_hook
/** This filter is documented in wp-admin/options-writing.php */
if ( apply_filters( 'enable_update_services_configuration', true ) ) {
?>
<h3 class="title"><?php _e('Update Services') ?></h3>

View File

@@ -335,7 +335,7 @@ if ( current_user_can( 'create_users') ) {
?>
<p><?php _e('Create a brand new user and add them to this site.'); ?></p>
<?php
//duplicate_hook
/** This action is documented in wp-admin/user-new.php */
?>
<form action="" method="post" name="createuser" id="createuser" class="validate"<?php do_action('user_new_form_tag');?>>
<input name="action" type="hidden" value="createuser" />
@@ -427,7 +427,7 @@ if ( apply_filters( 'show_password_fields', true ) ) : ?>
</table>
<?php
//duplicate_hook
/** This action is documented in wp-admin/user-new.php */
do_action( 'user_new_form', 'add-new-user' );
?>