Changeset 29490 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 08/14/2014 06:30:49 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r29454 r29490 2162 2162 2163 2163 $query['post_type'] = 'attachment'; 2164 $query['post_status'] = 'inherit'; 2164 if ( MEDIA_TRASH 2165 && ! empty( $_REQUEST['query']['post_status'] ) 2166 && 'trash' === $_REQUEST['query']['post_status'] ) { 2167 $query['post_status'] = 'trash'; 2168 } else { 2169 $query['post_status'] = 'inherit'; 2170 } 2171 2165 2172 if ( current_user_can( get_post_type_object( 'attachment' )->cap->read_private_posts ) ) 2166 2173 $query['post_status'] .= ',private'; … … 2216 2223 if ( isset( $changes['description'] ) ) 2217 2224 $post['post_content'] = $changes['description']; 2225 2226 if ( MEDIA_TRASH && isset( $changes['status'] ) ) 2227 $post['post_status'] = $changes['status']; 2218 2228 2219 2229 if ( isset( $changes['alt'] ) ) { … … 2244 2254 } 2245 2255 2246 wp_update_post( $post ); 2256 if ( MEDIA_TRASH && isset( $changes['status'] ) && 'trash' === $changes['status'] ) { 2257 wp_delete_post( $id ); 2258 } else { 2259 wp_update_post( $post ); 2260 } 2261 2247 2262 wp_send_json_success(); 2248 2263 }
Note: See TracChangeset
for help on using the changeset viewer.