Support » Fixing WordPress » How do I load a GPX file to a page?

Viewing 2 replies - 1 through 2 (of 2 total)
  • A plugin can add it to the list of permitted file types. Unfortunately I do not know an existing plugin that does that, but you might be able to find one. If you can write a plugin yourself, there is sample code here in the forums — I remember a similar question was asked recently (about a different file type).

    This is untested, but you should be able to add this to the functions.php file in your theme:

    function add_upload_mime_types( $mimes ) {
        if ( function_exists( 'current_user_can' ) )
            $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
        if ( !empty( $unfiltered ) ) {
            $mimes['gpx'] = 'application/gpx+xml';
        }
        return $mimes;
    }
    add_filter( 'upload_mimes', 'add_upload_mime_types' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I load a GPX file to a page?’ is closed to new replies.