Skip to content

Instantly share code, notes, and snippets.

@maheshwaghmare
Last active October 11, 2021 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maheshwaghmare/47b688b3626043d47b399f07a00a962c to your computer and use it in GitHub Desktop.
Save maheshwaghmare/47b688b3626043d47b399f07a00a962c to your computer and use it in GitHub Desktop.
Modify the MIME types of the Starter Templates
<?php
if ( ! function_exists( 'prefix_modify_mime_type' ) ) :
/**
* Modify the MIME types.
*
* @since x.x.x
*
* @param array $args File upload arguments.
* @return array.
*/
function prefix_modify_mime_type( $args ) {
$args['mimes']['json'] = 'text/plain';
return $args;
}
add_filter( 'ast_block_templates_wp_handle_sideload', 'prefix_modify_mime_type' );
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment