From 5361a8abca9ff362fa40fb6e4fbd9034b9aec77b Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 24 Oct 2013 22:59:20 +0000 Subject: [PATCH] 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 --- wp-admin/admin-ajax.php | 2 +- wp-admin/admin-post.php | 2 +- wp-admin/custom-background.php | 4 ++-- wp-admin/custom-header.php | 14 ++++++++++---- wp-admin/edit-form-advanced.php | 4 ++-- wp-admin/edit-link-form.php | 3 +++ wp-admin/includes/ajax-actions.php | 8 ++++---- wp-admin/includes/class-wp-posts-list-table.php | 4 +++- wp-admin/includes/dashboard.php | 2 ++ wp-admin/includes/export.php | 1 + wp-admin/includes/image-edit.php | 3 +++ wp-admin/includes/ms.php | 8 +------- wp-admin/includes/nav-menu.php | 2 +- wp-admin/includes/post.php | 1 + wp-admin/includes/revision.php | 2 +- wp-admin/options-writing.php | 6 +++--- wp-admin/user-new.php | 4 ++-- wp-content/themes/twentyeleven/content-single.php | 2 +- wp-content/themes/twentyeleven/functions.php | 2 +- wp-content/themes/twentyeleven/inc/widgets.php | 2 +- wp-content/themes/twentyten/loop-single.php | 2 +- wp-content/themes/twentytwelve/author.php | 8 +++++++- wp-content/themes/twentytwelve/content.php | 8 +------- wp-includes/canonical.php | 2 +- wp-includes/class-wp-embed.php | 2 +- wp-includes/comment.php | 1 + wp-includes/feed-atom-comments.php | 3 ++- wp-includes/feed-rdf.php | 3 ++- wp-includes/feed-rss2-comments.php | 10 +++++----- wp-includes/general-template.php | 7 +++++-- wp-includes/link-template.php | 1 + wp-includes/media-template.php | 1 + wp-includes/media.php | 1 + wp-includes/nav-menu-template.php | 2 +- wp-includes/post-template.php | 1 + wp-includes/post.php | 4 ++++ wp-login.php | 6 +++--- wp-mail.php | 1 + wp-signup.php | 12 ++++++------ 39 files changed, 89 insertions(+), 62 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 3cd167129b..b220d33226 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -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( diff --git a/wp-admin/admin-post.php b/wp-admin/admin-post.php index d5644cd98e..7103994073 100644 --- a/wp-admin/admin-post.php +++ b/wp-admin/admin-post.php @@ -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'; diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index 2691408e50..97656089ca 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -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 ) ) diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index b6a6e6c9c2..7b1a4b30a5 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -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 ) ); } diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 859d970254..dab3f84e5e 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -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) ); diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 59f425249f..ad2c6e54cd 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -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) ); diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 43990e2efe..e6c28344b1 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -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 ); diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index 24bfa0ff88..016a726b74 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -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 ); + } } } } diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 223d639ee3..1f71f243a0 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -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', ''); } diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php index 3b26b7162d..91d88a18ab 100644 --- a/wp-admin/includes/export.php +++ b/wp-admin/includes/export.php @@ -367,6 +367,7 @@ function export_wp( $args = array() ) { $is_sticky = is_sticky( $post->ID ) ? 1 : 0; ?> + <?php echo apply_filters( 'the_title_rss', $post->post_title ); ?> diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index 72e9037d1d..40cea96eb0 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -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 ); } diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index 44ac52459c..611fc00cfc 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -677,13 +677,7 @@ function choose_primary_blog() { diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index be9aee7d3a..d3aa7bd07d 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -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 ); diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 859d73a227..7d074dd779 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -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 ); } diff --git a/wp-admin/includes/revision.php b/wp-admin/includes/revision.php index ea714394ad..737c3b1637 100644 --- a/wp-admin/includes/revision.php +++ b/wp-admin/includes/revision.php @@ -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 ) ); diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php index 58d571ca75..cad326a96a 100644 --- a/wp-admin/options-writing.php +++ b/wp-admin/options-writing.php @@ -28,7 +28,7 @@ get_current_screen()->add_help_tab( array( 'content' => '

' . __('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’ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.') . '

', ) ); -//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.

@@ -168,7 +168,7 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_email_categor

diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php index c544dd4c38..937f4a3656 100644 --- a/wp-admin/user-new.php +++ b/wp-admin/user-new.php @@ -335,7 +335,7 @@ if ( current_user_can( 'create_users') ) { ?>

> @@ -427,7 +427,7 @@ if ( apply_filters( 'show_password_fields', true ) ) : ?> diff --git a/wp-content/themes/twentyeleven/content-single.php b/wp-content/themes/twentyeleven/content-single.php index 235ad73c30..11ac986b53 100644 --- a/wp-content/themes/twentyeleven/content-single.php +++ b/wp-content/themes/twentyeleven/content-single.php @@ -55,7 +55,7 @@
diff --git a/wp-content/themes/twentyeleven/functions.php b/wp-content/themes/twentyeleven/functions.php index cd67f512fe..b713933ca7 100644 --- a/wp-content/themes/twentyeleven/functions.php +++ b/wp-content/themes/twentyeleven/functions.php @@ -528,7 +528,7 @@ function twentyeleven_get_first_url() { if ( ! $has_url ) $has_url = twentyeleven_url_grabber(); - //duplicate_hook + /** This filter is documented in wp-includes/link-template.php */ return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } diff --git a/wp-content/themes/twentyeleven/inc/widgets.php b/wp-content/themes/twentyeleven/inc/widgets.php index 9e9c1f4ce3..c3f53e03ab 100644 --- a/wp-content/themes/twentyeleven/inc/widgets.php +++ b/wp-content/themes/twentyeleven/inc/widgets.php @@ -55,7 +55,7 @@ class Twenty_Eleven_Ephemera_Widget extends WP_Widget { ob_start(); extract( $args, EXTR_SKIP ); - //duplicate_hook + /** This filter is documented in wp-includes/default-widgets.php */ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base); if ( ! isset( $instance['number'] ) ) diff --git a/wp-content/themes/twentyten/loop-single.php b/wp-content/themes/twentyten/loop-single.php index 3bf252c1d0..a894b37da4 100644 --- a/wp-content/themes/twentyten/loop-single.php +++ b/wp-content/themes/twentyten/loop-single.php @@ -38,7 +38,7 @@
diff --git a/wp-content/themes/twentytwelve/author.php b/wp-content/themes/twentytwelve/author.php index 9838bad342..6570108e7e 100644 --- a/wp-content/themes/twentytwelve/author.php +++ b/wp-content/themes/twentytwelve/author.php @@ -48,7 +48,13 @@ get_header(); ?>
diff --git a/wp-content/themes/twentytwelve/content.php b/wp-content/themes/twentytwelve/content.php index 6ba7261883..daaad3447d 100644 --- a/wp-content/themes/twentytwelve/content.php +++ b/wp-content/themes/twentytwelve/content.php @@ -50,13 +50,7 @@
diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index b19a245bd3..231855ea50 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -296,7 +296,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { if ( 'wp-register.php' == basename( $redirect['path'] ) ) { if ( is_multisite() ) - //duplicate_hook + /** This filter is documented in wp-login.php */ $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); else $redirect_url = site_url( 'wp-login.php?action=register' ); diff --git a/wp-includes/class-wp-embed.php b/wp-includes/class-wp-embed.php index 275c2803b3..575066ccc0 100644 --- a/wp-includes/class-wp-embed.php +++ b/wp-includes/class-wp-embed.php @@ -215,7 +215,7 @@ class WP_Embed { // If there was a result, return it if ( $html ) { - //duplicate_hook + /** This filter is documented in wp-includes/class-wp-embed.php */ return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID ); } } diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 9692768d3c..9975158c74 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1772,6 +1772,7 @@ function do_trackbacks($post_id) { $excerpt = str_replace(']]>', ']]>', $excerpt); $excerpt = wp_html_excerpt($excerpt, 252, '…'); + /** This filter is documented in wp-includes/post-template.php */ $post_title = apply_filters('the_title', $post->post_title, $post->ID); $post_title = strip_tags($post_title); diff --git a/wp-includes/feed-atom-comments.php b/wp-includes/feed-atom-comments.php index 1a89c47955..a7777f198a 100644 --- a/wp-includes/feed-atom-comments.php +++ b/wp-includes/feed-atom-comments.php @@ -48,7 +48,8 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment(); <?php if ( !is_singular() ) { $title = get_the_title($comment_post->ID); - $title = apply_filters('the_title_rss', $title); + /** This filter is documented in wp-includes/feed.php */ + $title = apply_filters( 'the_title_rss', $title ); printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss()); } else { printf(ent2ncr(__('By: %s')), get_comment_author_rss()); diff --git a/wp-includes/feed-rdf.php b/wp-includes/feed-rdf.php index e572b03b7f..bf814dbbe5 100644 --- a/wp-includes/feed-rdf.php +++ b/wp-includes/feed-rdf.php @@ -30,8 +30,9 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> <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 //duplicate_hook ?> + <?php /** This filter is documented in wp-includes/feed-rss2.php */ ?> <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency> <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> <?php diff --git a/wp-includes/feed-rss2-comments.php b/wp-includes/feed-rss2-comments.php index fceeea1d50..41cc94fd06 100644 --- a/wp-includes/feed-rss2-comments.php +++ b/wp-includes/feed-rss2-comments.php @@ -15,7 +15,7 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" <?php - //duplicate_hook + /** This action is documented in wp-includes/feed-rss2.php */ do_action( 'rss2_ns' ); ?> @@ -41,9 +41,9 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; <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 //duplicate_hook ?> + <?php /** This filter is documented in wp-includes/feed-rss2.php */ ?> <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod> - <?php //duplicate_hook ?> + <?php /** This filter is documented in wp-includes/feed-rss2.php */ ?> <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency> <?php /** @@ -60,8 +60,8 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; <title><?php if ( !is_singular() ) { $title = get_the_title($comment_post->ID); - //duplicate_hook - $title = apply_filters('the_title_rss', $title); + /** This filter is documented in wp-includes/feed.php */ + $title = apply_filters( 'the_title_rss', $title ); printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss()); } else { printf(ent2ncr(__('By: %s')), get_comment_author_rss()); diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index dfa4b1c40b..90e19d4b72 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1078,10 +1078,12 @@ function wp_get_archives($args = '') { foreach ( (array) $results as $result ) { if ( $result->post_date != '0000-00-00 00:00:00' ) { $url = get_permalink( $result ); - if ( $result->post_title ) + if ( $result->post_title ) { + /** This filter is documented in wp-includes/post-template.php */ $text = strip_tags( apply_filters( 'the_title', $result->post_title, $result->ID ) ); - else + } else { $text = $result->ID; + } $output .= get_archives_link($url, $text, $format, $before, $after); } } @@ -1266,6 +1268,7 @@ function get_calendar($initial = true, $echo = true) { if ( $ak_post_titles ) { foreach ( (array) $ak_post_titles as $ak_post_title ) { + /** This filter is documented in wp-includes/post-template.php */ $post_title = esc_attr( apply_filters( 'the_title', $ak_post_title->post_title, $ak_post_title->ID ) ); if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) ) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 550a2029d2..38a0ab6e2d 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1425,6 +1425,7 @@ function get_adjacent_post_link( $format, $link, $in_same_cat = false, $excluded if ( empty( $post->post_title ) ) $title = $previous ? __( 'Previous Post' ) : __( 'Next Post' ); + /** This filter is documented in wp-includes/post-template.php */ $title = apply_filters( 'the_title', $title, $post->ID ); $date = mysql2date( get_option( 'date_format' ), $post->post_date ); $rel = $previous ? 'prev' : 'next'; diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index 6af7dc5f32..75f958e74e 100644 --- a/wp-includes/media-template.php +++ b/wp-includes/media-template.php @@ -341,6 +341,7 @@ function wp_print_media_templates() { <# } #>> <?php + /** This filter is documented in wp-admin/includes/media.php */ $sizes = apply_filters( 'image_size_names_choose', array( 'thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), diff --git a/wp-includes/media.php b/wp-includes/media.php index 8e150a597c..14972380c8 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1744,6 +1744,7 @@ function wp_prepare_attachment_for_js( $attachment ) { if ( $meta && 'image' === $type ) { $sizes = array(); + /** This filter is documented in wp-admin/includes/media.php */ $possible_sizes = apply_filters( 'image_size_names_choose', array( 'thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index 821fdde40f..7aceb8f67a 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -147,7 +147,7 @@ class Walker_Nav_Menu extends Walker { $item_output = $args->before; $item_output .= '<a'. $attributes .'>'; - //duplicate_hook + /** This filter is documented in wp-includes/post-template.php */ $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; $item_output .= '</a>'; $item_output .= $args->after; diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 9b3fe46f73..522ad3e18f 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -1071,6 +1071,7 @@ class Walker_Page extends Walker { if ( '' === $page->post_title ) $page->post_title = sprintf( __( '#%d (no title)' ), $page->ID ); + /** This filter is documented in wp-includes/post-template.php */ $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>'; if ( !empty($show_date) ) { diff --git a/wp-includes/post.php b/wp-includes/post.php index 4c669ad0aa..39d71a37c8 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4190,6 +4190,7 @@ function wp_delete_attachment( $post_id, $force_delete = false ) { // Don't delete the thumb if another attachment uses it if (! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $meta['thumb'] . '%', $post_id)) ) { $thumbfile = str_replace(basename($file), $meta['thumb'], $file); + /** This filter is documented in wp-admin/custom-header.php */ $thumbfile = apply_filters('wp_delete_file', $thumbfile); @ unlink( path_join($uploadpath['basedir'], $thumbfile) ); } @@ -4197,6 +4198,7 @@ function wp_delete_attachment( $post_id, $force_delete = false ) { // remove intermediate and backup images if there are any foreach ( $intermediate_sizes as $intermediate ) { + /** This filter is documented in wp-admin/custom-header.php */ $intermediate_file = apply_filters( 'wp_delete_file', $intermediate['path'] ); @ unlink( path_join($uploadpath['basedir'], $intermediate_file) ); } @@ -4204,11 +4206,13 @@ function wp_delete_attachment( $post_id, $force_delete = false ) { if ( is_array($backup_sizes) ) { foreach ( $backup_sizes as $size ) { $del_file = path_join( dirname($meta['file']), $size['file'] ); + /** This filter is documented in wp-admin/custom-header.php */ $del_file = apply_filters('wp_delete_file', $del_file); @ unlink( path_join($uploadpath['basedir'], $del_file) ); } } + /** This filter is documented in wp-admin/custom-header.php */ $file = apply_filters('wp_delete_file', $file); if ( ! empty($file) ) diff --git a/wp-login.php b/wp-login.php index 39526f822d..fb3fc4efc7 100644 --- a/wp-login.php +++ b/wp-login.php @@ -619,7 +619,7 @@ case 'rp' : <?php if ( get_option( 'users_can_register' ) ) : $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ); - //duplicate_hook + /** This filter is documented in wp-login.php */ echo ' | ' . apply_filters( 'register', $registration_url ); endif; ?> @@ -765,7 +765,7 @@ default: login_header( '', $message ); ?> </div> <?php - //duplicate_hook + /** This action is documented in wp-login.php */ do_action( 'login_footer' ); ?> <?php if ( $customize_login ) : ?> <script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script> @@ -869,7 +869,7 @@ default: <?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) : if ( get_option( 'users_can_register' ) ) : $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ); - //duplicate_hook + /** This filter is documented in wp-login.php */ echo apply_filters( 'register', $registration_url ) . ' | '; endif; ?> diff --git a/wp-mail.php b/wp-mail.php index 27290b1115..aab9183783 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -10,6 +10,7 @@ /** Make sure that the WordPress bootstrap has run before continuing. */ require(dirname(__FILE__) . '/wp-load.php'); +/** This filter is documented in wp-admin/options.php */ if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) wp_die( __( 'This action has been disabled by the administrator.' ) ); diff --git a/wp-signup.php b/wp-signup.php index ff8faa4cfc..0ecee1e1d6 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -433,7 +433,7 @@ function signup_user($user_name = '', $user_email = '', $errors = '') { <form id="setupform" method="post" action="wp-signup.php"> <input type="hidden" name="stage" value="validate-user-signup" /> <?php - //duplicate_hook + /** This action is documented in wp-signup.php */ do_action( 'signup_hidden_fields', 'validate-user' ); ?> <?php show_user_form($user_name, $user_email, $errors); ?> @@ -481,7 +481,7 @@ function validate_user_signup() { return false; } - //duplicate_hook + /** This filter is documented in wp-signup.php */ wpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) ); confirm_user_signup($user_name, $user_email); @@ -503,7 +503,7 @@ function confirm_user_signup($user_name, $user_email) { <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ), $user_email ); ?></p> <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p> <?php - //duplicate_hook + /** This action is documented in wp-signup.php */ do_action( 'signup_finished' ); } @@ -563,7 +563,7 @@ function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_ti <input type="hidden" name="user_name" value="<?php echo esc_attr($user_name) ?>" /> <input type="hidden" name="user_email" value="<?php echo esc_attr($user_email) ?>" /> <?php - //duplicate_hook + /** This action is documented in wp-signup.php */ do_action( 'signup_hidden_fields', 'validate-site' ); ?> <?php show_blog_form($blogname, $blog_title, $errors); ?> @@ -605,7 +605,7 @@ function validate_blog_signup() { $public = (int) $_POST['blog_public']; $meta = array ('lang_id' => 1, 'public' => $public); - //duplicate_hook + /** This filter is documented in wp-signup.php */ $meta = apply_filters( 'add_signup_meta', $meta ); wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta); @@ -642,7 +642,7 @@ function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $use </ul> </p> <?php - //duplicate_hook + /** This action is documented in wp-signup.php */ do_action( 'signup_finished' ); }