guid ); $attachment_id = $post->ID; if ( current_user_can( 'delete_post', $attachment_id ) ) { if ( !EMPTY_TRASH_DAYS ) { $delete = "" . __( 'Delete Permanently' ) . ''; } elseif ( !MEDIA_TRASH ) { $delete = "" . __( 'Delete' ) . " "; } else { $delete = "" . __( 'Move to Trash' ) . " "; } } else { $delete = ''; } $form_fields['buttons'] = array( 'tr' => "\t\t $delete\n" ); return $form_fields; } function gallery_image_upload_init(){ add_filter('flash_uploader', 'disable_flash_uploader'); add_filter('media_upload_tabs', 'image_upload_tabs'); add_filter('attachment_fields_to_edit', 'gallery_image_attachment_fields_to_edit', 10, 2); add_filter('media_upload_form_url', 'gallery_image_form_url', 10, 2); wp_enqueue_script('theme-gallery-image-upload', WPV_ADMIN_ASSETS_URI . 'js/gallery-image-upload.js'); } add_action('admin_init', 'gallery_image_upload_init');