MultiSite code snippet. Can’t upload ANY media.
-
“No items matched your search”
That’s what I get (and only that) when I try to upload a file into the Media Library.
The upload window opens fine, but the files on my desktop appear invisible.I have created a custom plugin for WordPress MultiSite WAAS which is designed to:
a) check if the current user is a “premium” plan customer
b) if they are NOT then restrict the MIME types they can upload to just static imagesBUT it seems like every MIME type has been removed.
Is this a quirk of MultiSite?
It seems to work as intended on a stand alone WP site.function restrict_mime($mimes) { if ( function_exists('is_plugin_active_for_network') ){ if ( is_plugin_active_for_network( 'wp-ultimo/wp-ultimo.php' ) ) { if ( !is_super_admin() ) { //get user id $user_id = get_current_user_id(); //define the Premium Pro plan ID $plan_id = 52; // restrict MIME types if the current user doesnt have Premium Pro plan if ( !wu_has_plan( $user_id, $plan_id ) ) { $mimes = array( 'jpg|jpeg' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png' ); return $mimes; } } } } } add_filter('upload_mimes','restrict_mime');
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘MultiSite code snippet. Can’t upload ANY media.’ is closed to new replies.