Changeset 22778 for trunk/wp-admin/custom-header.php
- Timestamp:
- 11/21/2012 05:44:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-header.php
r22695 r22778 94 94 if ( $this->admin_header_callback ) 95 95 add_action("admin_head-$page", $this->admin_header_callback, 51); 96 97 if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'custom-header' ) {98 add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 );99 add_filter( 'media_upload_tabs', array( $this, 'filter_upload_tabs' ) );100 add_filter( 'media_upload_mime_type_links', '__return_empty_array' );101 }102 96 } 103 97 … … 172 166 173 167 if ( ( 1 == $step || 3 == $step ) ) { 174 add_thickbox();175 168 wp_enqueue_media(); 176 169 wp_enqueue_script( 'custom-header' ); … … 911 904 912 905 /** 913 * Replace default attachment actions with "Set as header" link.906 * Unused since 3.5.0. 914 907 * 915 908 * @since 3.4.0 916 909 */ 917 function attachment_fields_to_edit( $form_fields, $post ) { 918 $form_fields = array(); 919 $href = esc_url(add_query_arg(array( 920 'page' => 'custom-header', 921 'step' => 2, 922 '_wpnonce-custom-header-upload' => wp_create_nonce('custom-header-upload'), 923 'file' => $post->ID 924 ), admin_url('themes.php'))); 925 926 $form_fields['buttons'] = array( 'tr' => '<tr class="submit"><td></td><td><a data-location="' . $href . '" class="wp-set-header">' . __( 'Set as header' ) . '</a></td></tr>' ); 927 $form_fields['context'] = array( 'input' => 'hidden', 'value' => 'custom-header' ); 928 910 function attachment_fields_to_edit( $form_fields ) { 929 911 return $form_fields; 930 912 } 931 913 932 914 /** 933 * Leave only "Media Library" tab in the uploader window.915 * Unused since 3.5.0. 934 916 * 935 917 * @since 3.4.0 936 918 */ 937 function filter_upload_tabs( ) {938 return array( 'library' => __('Media Library') );919 function filter_upload_tabs( $tabs ) { 920 return $tabs; 939 921 } 940 922
Note: See TracChangeset
for help on using the changeset viewer.