Make WordPress Core

Changeset 25821


Ignore:
Timestamp:
10/16/2013 11:25:30 PM (11 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-admin/custom-header.php.

Props gizburdt for the initial patch.
Fixes #25443.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-header.php

    r25254 r25821  
    634634<?php endif;
    635635
     636/**
     637 * Fires just before the submit button in the custom header options form.
     638 *
     639 * @since 3.1.0
     640 */
    636641do_action( 'custom_header_options' );
    637642
     
    691696            $this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
    692697
    693             do_action('wp_create_file_in_uploads', $file, $attachment_id); // For replication
     698            /**
     699             * Fires after the header image is set or an error is returned.
     700             *
     701             * @since 2.1.0
     702             *
     703             * @param string $file          Path to the file.
     704             * @param int    $attachment_id Attachment ID.
     705             */
     706            do_action( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication
     707
    694708            return $this->finished();
    695709        } elseif ( $width > $max_width ) {
     
    699713                wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
    700714
    701             $image = apply_filters('wp_create_file_in_uploads', $image, $attachment_id); // For replication
     715            //duplicate_hook
     716            $image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication
    702717
    703718            $url = str_replace(basename($url), basename($image), $url);
     
    840855            wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
    841856
    842         $cropped = apply_filters('wp_create_file_in_uploads', $cropped, $attachment_id); // For replication
     857        //duplicate_hook
     858        $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication
    843859
    844860        $parent = get_post($attachment_id);
     
    871887        // cleanup
    872888        $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
    873         if ( file_exists( $medium ) )
     889        if ( file_exists( $medium ) ) {
     890            //duplicate_hook
    874891            @unlink( apply_filters( 'wp_delete_file', $medium ) );
    875         if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) )
     892        }
     893
     894        if ( empty( $_POST['create-new-attachment'] ) && empty( $_POST['skip-cropping'] ) ) {
     895            //duplicate_hook
    876896            @unlink( apply_filters( 'wp_delete_file', $original ) );
     897        }
    877898
    878899        return $this->finished();
Note: See TracChangeset for help on using the changeset viewer.