How do I remove the Insert from URL link in the new WordPress 3.5 Add Media popup page? In earlier versions of WordPress, this worked fine:

// removes URL tab in image upload for post
function remove_media_library_tab($tabs) { 
    if (isset($_REQUEST['post_id'])) {
        $post_type = get_post_type($_REQUEST['post_id']);
        if ('premium' == $post_type)
            unset($tabs['library']);
            unset($tabs['type_url']);
    }
    return $tabs;
}
add_filter('media_upload_tabs', 'remove_media_library_tab');

Who knows?

2 s
2

This should work:

add_filter( 'media_view_strings', 'cor_media_view_strings' );
/**
 * Removes the media 'From URL' string.
 *
 * @see wp-includes|media.php
 */
function cor_media_view_strings( $strings ) {
    unset( $strings['insertFromUrlTitle'] );
    return $strings;
}

Leave a Reply

Your email address will not be published. Required fields are marked *