Skip to content

Instantly share code, notes, and snippets.

View acolson's full-sized avatar

Aaron Olson acolson

View GitHub Profile
@acolson
acolson / additional-mime-types
Created July 12, 2014 16:08
Allow WordPress to upload MP4, WebM and OGG video
add_filter( 'mime_types', 'aco_extend_mime_types' );
function aco_extend_mime_types( $existing_mimes ) {
// Add webm, mp4 and OGG to the list of mime types
$existing_mimes['webm'] = 'video/webm';
$existing_mimes['mp4'] = 'video/mp4';
$existing_mimes['ogg'] = 'video/ogg';
// Return an array now including our added mime types
@acolson
acolson / last-modified-admin-columns
Last active June 3, 2020 09:49
WordPress sortable custom admin column for last modified date and user
add_filter( 'manage_edit-post_columns', 'aco_last_modified_admin_column' );
// Create the last modified column
function aco_last_modified_admin_column( $columns ) {
$columns['modified-last'] =__( 'Last Modified', 'aco' );
return $columns;
}
add_filter( 'manage_edit-post_sortable_columns', 'aco_sortable_last_modified_column' );