Hiding media uploaded by other users in wordpress multisite?

/** * Allow access to own content only */ function my_authored_content($query) { //get current user info to see if they are allowed to access ANY posts and pages $current_user = wp_get_current_user(); // set current user to $is_user $is_user = $current_user->user_login; //if is admin or ‘is_user’ does not equal #username if (!current_user_can(‘manage_options’)){ //if in the admin … Read more

Issue when uploading past 8MB?

In your php.ini make sure you’re changing both of the following lines. upload_max_filesize = 250M post_max_size = 250M If you are using FastCGI as your PHP engine you’ll also need to up its limit in Apache. Try adding FcgidMaxRequestLen to your VirtualHost (see http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidmaxrequestlen for more info on the directive). Finally, if you’re on NGINX … Read more

Can I use the same Folder name as a Multisite Blog?

By default, yes, you will have conflicts. The default WordPress .htaccess rules look something like this: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress The -f and -d in those lines are important here. They basically … Read more

Incorrect filenames in load-scripts.php parameters

Do you have the “all-in-one-wp-security-and-firewall” plugin? More info: https://wordpress.org/support/topic/load-scriptphp-fails-to-load?replies=3 Short answer, if so, disable the “Deny Bad Query Strings” option. If not, check for any other “security” plugins you have that might be doing dumb things.

WordPress upload file action hook

Try this way, should work well function cpt_from_attachment($attachment_ID) { global $current_user; get_currentuserinfo(); $attachment_post = get_post( $attachment_ID ); $type = get_post_mime_type($attachment_ID); // DO WHAT YOU NEED } add_action(“add_attachment”, ‘cpt_from_attachment’);

Detect plugin/theme installation (via upload)

I think your best bet here is to hook into the flow at the time of uploading and processing the uploaded file. There is a filter (line 327, file.php): apply_filters( ‘wp_handle_upload’, array( ‘file’ => $new_file, ‘url’ => $url, ‘type’ => $type ), ‘upload’ ); You could create a filter within which you do nothing else … Read more