equal
deleted
inserted
replaced
43 exit; |
43 exit; |
44 } |
44 } |
45 |
45 |
46 // No break. |
46 // No break. |
47 case 'edit': |
47 case 'edit': |
|
48 // Used in the HTML title tag. |
48 $title = __( 'Edit Media' ); |
49 $title = __( 'Edit Media' ); |
49 |
50 |
50 if ( empty( $errors ) ) { |
51 if ( empty( $errors ) ) { |
51 $errors = null; |
52 $errors = null; |
52 } |
53 } |
62 } |
63 } |
63 |
64 |
64 $att = get_post( $att_id ); |
65 $att = get_post( $att_id ); |
65 |
66 |
66 if ( empty( $att->ID ) ) { |
67 if ( empty( $att->ID ) ) { |
67 wp_die( __( 'You attempted to edit an attachment that doesn’t exist. Perhaps it was deleted?' ) ); |
68 wp_die( __( 'You attempted to edit an attachment that does not exist. Perhaps it was deleted?' ) ); |
68 } |
69 } |
69 if ( 'attachment' !== $att->post_type ) { |
70 if ( 'attachment' !== $att->post_type ) { |
70 wp_die( __( 'You attempted to edit an item that isn’t an attachment. Please go back and try again.' ) ); |
71 wp_die( __( 'You attempted to edit an item that is not an attachment. Please go back and try again.' ) ); |
71 } |
72 } |
72 if ( 'trash' === $att->post_status ) { |
73 if ( 'trash' === $att->post_status ) { |
73 wp_die( __( 'You can’t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.' ) ); |
74 wp_die( __( 'You cannot edit this attachment because it is in the Trash. Please move it out of the Trash and try again.' ) ); |
74 } |
75 } |
75 |
76 |
76 add_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 ); |
77 add_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 ); |
77 |
78 |
78 wp_enqueue_script( 'wp-ajax-response' ); |
79 wp_enqueue_script( 'wp-ajax-response' ); |