Skip to content

Instantly share code, notes, and snippets.

View knutsp's full-sized avatar

Knut Sparhell knutsp

View GitHub Profile
@afragen
afragen / mu-loader.php
Last active May 30, 2024 18:05
A generic mu-plugins loader for plugins stored in wp-content/plugins folder.
<?php
/**
* MU Loader
*
* @author Andy Fragen, Colin Stewart
* @license MIT
* @package mu-plugins
*/
/**
<?php
/**
* Auto-Update Enabler
*
* Decisions, not options. Inspired by Trac ticket #58389 by
* Jos Velasco and an offhanded comment on the fedi by Andy
* Fragen.
*
* @package Auto-Update Enabler
* @author Jason Cosper <boogah@gmail.com>
@danielbachhuber
danielbachhuber / gist:9550397
Created March 14, 2014 15:48
In multisite, give editors and above the ability to upload whatever they want.
<?php
/**
* Allow editors and above to upload whatever they want
*/
add_filter( 'map_meta_cap', function( $caps, $cap, $user_id ) {
if ( 'unfiltered_upload' !== $cap ) {
return $caps;
}
@jmahony
jmahony / script.php
Created May 31, 2013 16:16
WordPress: delete unwanted capabilities
<?php
// Function to delete capabilities
// http://chrisburbridge.com/delete-unwanted-wordpress-custom-capabilities/
add_action( 'admin_init', 'clean_unwanted_caps' );
function clean_unwanted_caps() {
global $wp_roles;
$delete_caps = array(
'capability1'