WordPress Media mime type filter problem 4.0

Here’s a workaround you can put in a plugin or your theme’s functions.php file. So far no problems.

/*
* Workaround Bug 30123
* Affects WP 4.0+, should be fixed in WP 4.1
* https://core.trac.wordpress.org/ticket/30123
*/
function bugfix30123__action__admin_init() {
    if ( isset( $_GET['attachment-filter'] ) && is_string( $_GET['attachment-filter'] ) ) {
        $_GET['attachment-filter'] = $_REQUEST['attachment-filter'] = str_replace( '%2F', "https://wordpress.stackexchange.com/", $_GET['attachment-filter'] );
    }
}
add_action( 'admin_init', 'bugfix30123__action__admin_init' );

Leave a Comment