$dir['basedir'] . '/gpx', 'url' => $dir['baseurl'] . '/gpx', 'subdir' => '/gpx', ) + $dir; } function wpgpxmaps_move_uploaded_file($uploadedfile) { // Register our path override. add_filter( 'upload_dir', 'wpgpxmaps_181088_upload_dir' ); $upload_overrides = array( 'test_form' => false, 'test_type' => false ); // Do our thing. WordPress will move the file to 'uploads/gpx'. $result = wp_handle_upload( $uploadedfile , $upload_overrides); // Set everything back to normal. remove_filter( 'upload_dir', 'wpgpxmaps_181088_upload_dir' ); if ( $result && isset( $result['error'] )) { echo "
". esc_html( $result['error'] )."
'; esc_html_e( 'Cache is now empty!', 'wp-gpx-maps' ); echo '
'; printf( /* translators: %1s: GPX file name */ esc_html__( 'The file %1s has been successfully uploaded.', 'wp-gpx-maps' ), '' . esc_html( $uploadingFileName ) . '' ); echo '
'; esc_html_e( 'There was an error uploading the file, please try again!', 'wp-gpx-maps' ); echo '
'; esc_html_e( 'The file type is not supported!', 'wp-gpx-maps' ); echo '
'; printf( /* translators: %1s: Relative path of the GPX folder */ esc_html__( 'Your folder for GPX files %1s is not writable. Please change the folder permissions.', 'wp-gpx-maps' ), '' . esc_html( $relativeGpxPath ) . '' ); echo '
'; ?>'; printf( /* translators: %1s: GPX file name */ esc_html__( 'The file %1s has been successfully deleted.', 'wp-gpx-maps' ), '' . esc_html( $entry ) . '' ); echo '
'; } else { echo ''; printf( /* translators: %1s: GPX file name */ esc_html__( 'The file %1s could not be deleted.', 'wp-gpx-maps' ), '' . esc_html( $entry ) . '' ); echo '