Ticket #20819: 20819.2.patch
| File 20819.2.patch, 1.6 KB (added by SergeyBiryukov, 12 months ago) |
|---|
-
wp-admin/custom-header.php
96 96 97 97 add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 ); 98 98 add_filter( 'media_upload_tabs', array( $this, 'filter_upload_tabs' ) ); 99 add_filter( 'media_upload_mime_type_links', array( $this, 'filter_upload_mime_type_links' ) ); 99 100 } 100 101 101 102 /** … … 805 806 } 806 807 807 808 809 /** 810 * Upload the file to be cropped in the second step. 811 * 812 * @since 3.4.0 813 */ 808 814 function step_2_manage_upload() { 809 815 $overrides = array('test_form' => false); 810 816 $file = wp_handle_upload($_FILES['import'], $overrides); … … 960 966 $this->step_1(); 961 967 } 962 968 969 /** 970 * Replace default attachment actions with "Set as header" link. 971 * 972 * @since 3.4.0 973 */ 963 974 function attachment_fields_to_edit( $form_fields, $post ) { 964 975 if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'custom-header' ) { 965 976 $form_fields = array(); … … 977 988 return $form_fields; 978 989 } 979 990 991 /** 992 * Leave only "Media Library" tab in the uploader window. 993 * 994 * @since 3.4.0 995 */ 980 996 function filter_upload_tabs( $tabs ) { 981 997 if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'custom-header' ) 982 998 return array( 'library' => __('Media Library') ); … … 984 1000 return $tabs; 985 1001 } 986 1002 1003 /** 1004 * Hide MIME type links. Only image files can be set as header. 1005 * 1006 * @since 3.4.0 1007 */ 1008 function filter_upload_mime_type_links() { 1009 return array(); 1010 } 1011 987 1012 }
