function my_myme_types( $mime_types ) {
$mime_types['svg'] = 'image/svg+xml'; //Adding svg extension
$mime_types['psd'] = 'image/vnd.adobe.photoshop'; //Adding photoshop files
return $mime_types;
}
add_filter( 'upload_mimes', 'my_myme_types', 1, 1 );
Media
Only Show Current User’s Media Attachments
/*
* Only Show Current User's Media Attachments
*/
function show_current_user_attachments( $query = array() ) {
$user_id = get_current_user_id();
if ( $user_id ) {
$query[ 'author' ] = $user_id;
}
return $query;
}
add_filter( 'ajax_query_attachments_args', 'show_current_user_attachments', 10, 1 );