WordPress.org

Make WordPress Core

Changeset 20982


Ignore:
Timestamp:
06/04/2012 02:37:57 PM (6 years ago)
Author:
ryan
Message:

Don't show mime type filter links when choosing an image header from the media library. Props SergeyBiryukov, georgestephanis. fixes #20819

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r20981 r20982  
    9797        add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 );
    9898        add_filter( 'media_upload_tabs', array( $this, 'filter_upload_tabs' ) );
     99        add_filter( 'media_upload_mime_type_links', '__return_empty_array' );
    99100    }
    100101
     
    806807
    807808
     809    /**
     810     * Upload the file to be cropped in the second step.
     811     *
     812     * @since 3.4.0
     813     */
    808814    function step_2_manage_upload() {
    809815        $overrides = array('test_form' => false);
     
    961967    }
    962968
     969    /**
     970     * Replace default attachment actions with "Set as header" link.
     971     *
     972     * @since 3.4.0
     973     */
    963974    function attachment_fields_to_edit( $form_fields, $post ) {
    964975        if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'custom-header' ) {
     
    978989    }
    979990
     991    /**
     992     * Leave only "Media Library" tab in the uploader window.
     993     *
     994     * @since 3.4.0
     995     */
    980996    function filter_upload_tabs( $tabs ) {
    981997        if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'custom-header' )
Note: See TracChangeset for help on using the changeset viewer.