Make WordPress Core

Ticket #25658: 25658.diff

File 25658.diff, 17.4 KB (added by DrewAPicture, 13 years ago)

_action/_filter

  • src/wp-admin/admin-ajax.php

     
    3838send_nosniff_header();
    3939nocache_headers();
    4040
    41 //duplicate_hook
     41//duplicate_action
    4242do_action( 'admin_init' );
    4343
    4444$core_actions_get = array(
  • src/wp-admin/admin-post.php

     
    2323
    2424nocache_headers();
    2525
    26 //duplicate_hook
     26//duplicate_action
    2727do_action( 'admin_init' );
    2828
    2929$action = 'admin_post';
  • src/wp-admin/custom-background.php

     
    386386                $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
    387387                set_theme_mod('background_image_thumb', esc_url_raw( $thumbnail[0] ) );
    388388
    389                 //duplicate_hook
     389                //duplicate_action
    390390                do_action( 'wp_create_file_in_uploads', $file, $id ); // For replication
    391391                $this->updated = true;
    392392        }
     
    412412        public function wp_set_background_image() {
    413413                if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit;
    414414                $attachment_id = absint($_POST['attachment_id']);
    415                 //duplicate_hook
     415                //duplicate_filter
    416416                $sizes = array_keys(apply_filters( 'image_size_names_choose', array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size')) ));
    417417                $size = 'thumbnail';
    418418                if ( in_array( $_POST['size'], $sizes ) )
  • src/wp-admin/custom-header.php

     
    712712                        if ( ! $image || is_wp_error( $image ) )
    713713                                wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
    714714
    715                         //duplicate_hook
     715                        //duplicate_filter
    716716                        $image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication
    717717
    718718                        $url = str_replace(basename($url), basename($image), $url);
     
    854854                if ( ! $cropped || is_wp_error( $cropped ) )
    855855                        wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
    856856
    857                 //duplicate_hook
     857                //duplicate_filter
    858858                $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication
    859859
    860860                $parent = get_post($attachment_id);
     
    887887                // cleanup
    888888                $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
    889889                if ( file_exists( $medium ) ) {
    890                         //duplicate_hook
     890                        //duplicate_filter
    891891                        @unlink( apply_filters( 'wp_delete_file', $medium ) );
    892892                }
    893893
    894894                if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) {
    895                         //duplicate_hook
     895                        //duplicate_filter
    896896                        @unlink( apply_filters( 'wp_delete_file', $original ) );
    897897                }
    898898
  • src/wp-admin/edit-form-advanced.php

     
    239239 * @param WP_Post $post      Post object.
    240240 */
    241241do_action( 'do_meta_boxes', $post_type, 'normal', $post );
    242 //duplicate_hook
     242//duplicate_action
    243243do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
    244 //duplicate_hook
     244//duplicate_action
    245245do_action( 'do_meta_boxes', $post_type, 'side', $post );
    246246
    247247add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
  • src/wp-admin/includes/ajax-actions.php

     
    190190        if ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) )
    191191                wp_die( -1 );
    192192
    193         //duplicate_hook
     193        //duplicate_filter
    194194        if ( ! is_super_admin() && ! apply_filters( 'autocomplete_users_for_site_admins', false ) )
    195195                wp_die( -1 );
    196196
     
    20022002        if ( 'attachment' != $post['post_type'] )
    20032003                wp_send_json_error();
    20042004
    2005         //duplicate_hook
     2005        //duplicate_filter
    20062006        $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
    20072007
    20082008        if ( isset( $post['errors'] ) ) {
     
    21052105                $html = stripslashes_deep( $_POST['html'] );
    21062106        }
    21072107
    2108         //duplicate_hook
     2108        //duplicate_filter
    21092109        $html = apply_filters( 'media_send_to_editor', $html, $id, $attachment );
    21102110
    21112111        wp_send_json_success( $html );
     
    21462146                && ( 'audio' == $ext_type || 'video' == $ext_type ) )
    21472147                        $type = $ext_type;
    21482148
    2149         //duplicate_hook
     2149        //duplicate_filter
    21502150        $html = apply_filters( $type . '_send_to_editor_url', $html, $src, $title );
    21512151
    21522152        wp_send_json_success( $html );
  • src/wp-admin/includes/nav-menu.php

     
    308308                if ( ! empty( $item->label ) ) {
    309309                        $title = $item->label;
    310310                } elseif ( isset( $item->post_type ) ) {
    311                         //duplicate_hook
     311                        //duplicate_filter
    312312                        $title = apply_filters( 'the_title', $item->post_title, $item->ID );
    313313                        if ( ! empty( $item->front_or_home ) && _x( 'Home', 'nav menu home label' ) !== $title )
    314314                                $title = sprintf( _x( 'Home: %s', 'nav menu front page title' ), $title );
  • src/wp-admin/includes/revision.php

     
    7070                 */
    7171                $content_from = $compare_from ? apply_filters( "_wp_post_revision_field_$field", $compare_from->$field, $field, $compare_from, 'from' ) : '';
    7272
    73                 //duplicate_hook
     73                //duplicate_filter
    7474                $content_to = apply_filters( "_wp_post_revision_field_$field", $compare_to->$field, $field, $compare_to, 'to' );
    7575
    7676                $diff = wp_text_diff( $content_from, $content_to, array( 'show_split_view' => true ) );
  • src/wp-admin/options-writing.php

     
    2828        '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>',
    2929) );
    3030
    31 //duplicate_hook
     31//duplicate_filter
    3232if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
    3333        get_current_screen()->add_help_tab( array(
    3434                'id'      => 'options-postemail',
     
    131131</div>
    132132
    133133<?php
    134 //duplicate_hook
     134//duplicate_filter
    135135if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
    136136?>
    137137<h3 class="title"><?php _e('Post via e-mail') ?></h3>
     
    168168<?php } ?>
    169169
    170170<?php
    171 //duplicate_hook
     171//duplicate_filter
    172172if ( apply_filters( 'enable_update_services_configuration', true ) ) {
    173173?>
    174174<h3 class="title"><?php _e('Update Services') ?></h3>
  • src/wp-admin/user-new.php

     
    335335?>
    336336<p><?php _e('Create a brand new user and add them to this site.'); ?></p>
    337337<?php
    338 //duplicate_hook
     338//duplicate_action
    339339?>
    340340<form action="" method="post" name="createuser" id="createuser" class="validate"<?php do_action('user_new_form_tag');?>>
    341341<input name="action" type="hidden" value="createuser" />
     
    427427</table>
    428428
    429429<?php
    430 //duplicate_hook
     430//duplicate_action
    431431do_action( 'user_new_form', 'add-new-user' );
    432432?>
    433433
  • src/wp-content/themes/twentyeleven/content-single.php

     
    5555                <div id="author-info">
    5656                        <div id="author-avatar">
    5757                                <?php
    58                                 //duplicate_hook
     58                                //duplicate_filter
    5959                                echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) );
    6060                                ?>
    6161                        </div><!-- #author-avatar -->
  • src/wp-content/themes/twentyeleven/functions.php

     
    528528        if ( ! $has_url )
    529529                $has_url = twentyeleven_url_grabber();
    530530
    531         //duplicate_hook
     531        //duplicate_filter
    532532        return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
    533533}
    534534
  • src/wp-content/themes/twentyeleven/inc/widgets.php

     
    5555                ob_start();
    5656                extract( $args, EXTR_SKIP );
    5757
    58                 //duplicate_hook
     58                //duplicate_filter
    5959                $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base);
    6060
    6161                if ( ! isset( $instance['number'] ) )
  • src/wp-content/themes/twentyten/loop-single.php

     
    3838                                        <div id="entry-author-info">
    3939                                                <div id="author-avatar">
    4040                                                        <?php
    41                                                         //duplicate_hook
     41                                                        //duplicate_filter
    4242                                                        echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) );
    4343                                                        ?>
    4444                                                </div><!-- #author-avatar -->
  • src/wp-content/themes/twentytwelve/author.php

     
    4848                        <div class="author-info">
    4949                                <div class="author-avatar">
    5050                                        <?php
    51                                         //duplicate_hook
     51                                        //duplicate_filter
    5252                                        $author_bio_avatar_size = apply_filters( 'twentytwelve_author_bio_avatar_size', 68 );
    5353                                        echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
    5454                                        ?>
  • src/wp-includes/canonical.php

     
    296296
    297297                if ( 'wp-register.php' == basename( $redirect['path'] ) ) {
    298298                        if ( is_multisite() )
    299                                 //duplicate_hook
     299                                //duplicate_filter
    300300                                $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
    301301                        else
    302302                                $redirect_url = site_url( 'wp-login.php?action=register' );
  • src/wp-includes/class-wp-embed.php

     
    215215
    216216                        // If there was a result, return it
    217217                        if ( $html ) {
    218                                 //duplicate_hook
     218                                //duplicate_filter
    219219                                return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID );
    220220                        }
    221221                }
  • src/wp-includes/feed-rdf.php

     
    3131        <description><?php bloginfo_rss('description') ?></description>
    3232        <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></dc:date>
    3333        <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
    34         <?php //duplicate_hook ?>
     34        <?php //duplicate_filter ?>
    3535        <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
    3636        <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    3737        <?php
  • src/wp-includes/feed-rss2-comments.php

     
    1515        xmlns:atom="http://www.w3.org/2005/Atom"
    1616        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    1717        <?php
    18         //duplicate_hook
     18        //duplicate_action
    1919        do_action( 'rss2_ns' );
    2020        ?>
    2121
     
    4141        <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
    4242        <description><?php bloginfo_rss("description") ?></description>
    4343        <lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
    44         <?php //duplicate_hook ?>
     44        <?php //duplicate_filter ?>
    4545        <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
    46         <?php //duplicate_hook ?>
     46        <?php //duplicate_filter ?>
    4747        <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
    4848        <?php
    4949        /**
     
    6060                <title><?php
    6161                        if ( !is_singular() ) {
    6262                                $title = get_the_title($comment_post->ID);
    63                                 //duplicate_hook
     63                                //duplicate_filter
    6464                                $title = apply_filters('the_title_rss', $title);
    6565                                printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
    6666                        } else {
  • src/wp-includes/nav-menu-template.php

     
    147147
    148148                $item_output = $args->before;
    149149                $item_output .= '<a'. $attributes .'>';
    150                 //duplicate_hook
     150                //duplicate_filter
    151151                $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
    152152                $item_output .= '</a>';
    153153                $item_output .= $args->after;
  • src/wp-login.php

     
    619619<?php
    620620if ( get_option( 'users_can_register' ) ) :
    621621        $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
    622         //duplicate_hook
     622        //duplicate_filter
    623623        echo ' | ' . apply_filters( 'register', $registration_url );
    624624endif;
    625625?>
     
    765765                        login_header( '', $message ); ?>
    766766                        </div>
    767767                        <?php
    768                         //duplicate_hook
     768                        //duplicate_action
    769769                        do_action( 'login_footer' ); ?>
    770770                        <?php if ( $customize_login ) : ?>
    771771                                <script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>
     
    869869<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) :
    870870        if ( get_option( 'users_can_register' ) ) :
    871871                $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
    872                 //duplicate_hook
     872                //duplicate_filter
    873873                echo apply_filters( 'register', $registration_url ) . ' | ';
    874874        endif;
    875875        ?>
  • src/wp-signup.php

     
    433433        <form id="setupform" method="post" action="wp-signup.php">
    434434                <input type="hidden" name="stage" value="validate-user-signup" />
    435435                <?php
    436                 //duplicate_hook
     436                //duplicate_action
    437437                do_action( 'signup_hidden_fields', 'validate-user' );
    438438                ?>
    439439                <?php show_user_form($user_name, $user_email, $errors); ?>
     
    481481                return false;
    482482        }
    483483
    484         //duplicate_hook
     484        //duplicate_filter
    485485        wpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) );
    486486
    487487        confirm_user_signup($user_name, $user_email);
     
    503503        <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ), $user_email ); ?></p>
    504504        <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p>
    505505        <?php
    506         //duplicate_hook
     506        //duplicate_action
    507507        do_action( 'signup_finished' );
    508508}
    509509
     
    563563                <input type="hidden" name="user_name" value="<?php echo esc_attr($user_name) ?>" />
    564564                <input type="hidden" name="user_email" value="<?php echo esc_attr($user_email) ?>" />
    565565                <?php
    566                 //duplicate_hook
     566                //duplicate_action
    567567                do_action( 'signup_hidden_fields', 'validate-site' );
    568568                ?>
    569569                <?php show_blog_form($blogname, $blog_title, $errors); ?>
     
    605605        $public = (int) $_POST['blog_public'];
    606606        $meta = array ('lang_id' => 1, 'public' => $public);
    607607
    608         //duplicate_hook
     608        //duplicate_filter
    609609        $meta = apply_filters( 'add_signup_meta', $meta );
    610610
    611611        wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);
     
    642642                </ul>
    643643        </p>
    644644        <?php
    645         //duplicate_hook
     645        //duplicate_action
    646646        do_action( 'signup_finished' );
    647647}
    648648