Issue with Custom Roles in Multisite

So, thanks to kaiser, I was able to figure it out. I had to do two things to make this work. First, I noticed that disabling the WP User Avatar plugin was causing the errors to disappear. I looked and realized that a setting was checked “allow subscribers and contributors to edit their avatars.” Unchecking … Read more

How to setup LDAP authentication with WP multisite

This is a recently updated plugin that should allow you to authenticate via LDAP: http://wordpress.org/plugins/auth0/ It supports LDAP SSO as well as a bunch of other authentication methods. It says it supports multiple WordPress instances, so I assume that means multisite as well. Hope this helps!

How to check if image is already stored in a site’s post database? (network)

Yes, a database query is possible with WordPress: function is_image_in_network( $image_name ) { global $wpdb; $image = “uploads/2012/01/{$image_name}”; $value=”%”.like_escape( $image ).’%’; $blog_id = get_current_blog_id(); $wpdb->set_blog_id( $blog_id ); $image = $wpdb->get_var( $wpdb->prepare( “SELECT ID FROM {$wpdb->posts} WHERE post_status=”publish” AND post_content LIKE ‘%s'” , $value ) ); return is_null( $image ) ? false : true; } You … Read more

How to hide admin account in BuddyPress? (for security reasons)

I found this: Exclude Users from Members directory on a BuddyPress based social network We will need to hook to ‘bp_ajax_querystring’ filter. The following code will allow to exclude the users from the members directory. They will be still listed in the friends list of other users with whom they are friends with. add_action(‘bp_ajax_querystring’,’bpdev_exclude_users’,20,2); function … Read more

Using same directory for storing all uploaded images on a WordPress network

You can pretty simple add some actions to archive this. function wpse_16722_main_uploads() { switch_to_blog(1); } add_action(‘load-media-new.php’, ‘wpse_16722_main_uploads’); add_action(‘load-media-upload.php’, ‘wpse_16722_main_uploads’); add_action(‘load-media.php’, ‘wpse_16722_main_uploads’); add_action(‘load-upload.php’, ‘wpse_16722_main_uploads’); add_action(‘admin_init’, ‘wpse_16722_main_uploads’); This will change the current sub-blog to user your main-site with the help of switch_to_blog and of course you want the main side by the id 1. You can also … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)