Skip to content

Instantly share code, notes, and snippets.

@FellowshipAgency
FellowshipAgency / gist:39769bb126a842d264f2
Last active December 17, 2017 07:51
Extra Mime Types - WordPress
if(!function_exists('rp_modify_post_mime_types')) {
function rp_modify_post_mime_types($post_mime_types) {
$post_mime_types['application/pdf'] = array(__('PDF'), __('Manage PDF'), _n_noop('PDF <span class="count">(%s)</span>', 'PDF <span class="count">(%s)</span>'));
$post_mime_types['text/csv'] = array(__('CSV'), __('Manage CSV'), _n_noop('CSV <span class="count">(%s)</span>', 'CSV <span class="count">(%s)</span>'));
$post_mime_types['application/vnd.openxmlformats-officedocument.wordprocessingml.document'] = array(__('Word Doc'), __('Manage Word Doc'), _n_noop('Word Doc <span class="count">(%s)</span>', 'Word Doc <span class="count">(%s)</span>'));
$post_mime_types['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] = array(__('Excel'), __('Manage Excel'), _n_noop('Excel <span class="count">(%s)</span>', 'Excel <span class="count">(%s)</span>'));
$post_mime_types['application/vnd.ms-excel.sheet.macroEnabled.12'] = array(__('Excel (Macro Enabled)'), __('Manage Excel'), _n
@FellowshipAgency
FellowshipAgency / swipecontrols.js
Created October 12, 2014 12:14
Add swipe controls to colorbox
// Requires Touchswipe.js https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
jQuery(document).bind('cbox_open', function(){
jQuery("#colorbox").swipe( {
//Generic swipe handler for all directions
swipeLeft:function(event, direction, distance, duration, fingerCount) {
jQuery.colorbox.prev();
},
swipeRight:function(event, direction, distance, duration, fingerCount) {
jQuery.colorbox.next();