Skip to content

Instantly share code, notes, and snippets.

View upload_mime.php
<?php
add_filter('upload_mimes','external_mimes');
function external_mimes($mimes){
return array_merge($mimes,array (
'rar'=> 'application/x-rar-compressed', // you can add more?
));
}
View wordpress-3.8-dashicons.php
<?php
/*
* WP 3.8 Add CPT Admin icon
*/
add_action( 'admin_head', 'cpt_admin_icon' );
function cpt_admin_icon(){
echo '
<style>
#adminmenu #menu-posts-project div.wp-menu-image:before { content: "\f100"; }
View Hide Add Media Button
<?php
function RemoveAddMediaButtonsForNonAdmins(){
if ( !current_user_can( 'manage_options' ) ) {
remove_action( 'media_buttons', 'media_buttons' );
}
}
add_action('admin_head', 'RemoveAddMediaButtonsForNonAdmins');
View thumbnail-carousel.bxslider.html