when does output of get_user_count turns into an array?

Via: http://lists.automattic.com/pipermail/wp-hackers/2012-June/043295.html http://wordpress.org/support/topic/illegal-string-offset-total_users?replies=14#post-2893756 https://core.trac.wordpress.org/ticket/20966 I find: Normally it would return an array from the cache Meaning the return value of get_user_count() is different than in the php doc above it But… if the cache does not contain it, it will return an integer leading (in my case) to an warning (requesting an array value from … Read more

How can I let users open the site for other visitors?

Based on Bainternet’s answer to this question: Save Theme Options (options.php) From The Frontend The key is to know the name of the plugin option to Enable/Disable the Maintenance Mode. In this example, it’s named: my_maintenance_mode <?php if ( isset($_POST[‘mmode’]) && isset($_POST[‘action’]) && $_POST[‘action’] == “update_mmode” ) { if ( wp_verify_nonce( $_POST[‘theme_front_end’], ‘update-options’ ) ) … Read more

Using and saving custom dropdown boxes on user profiles

You appear to be checking for variables that aren’t set. You set $selected $selected = get_the_author_meta( ‘user_top’, $user->ID ); But then you check for something called $topselected <select name=”user_top” id=”user_top”> <option value=”gotguns” <?php echo ($topselected == “gotguns”)? ‘selected=”selected”‘ : ” ?>>I got guns</option> The same thing happns with $middleselected and $bottomselected I think your problem … Read more

Modify Profile Biographical Info Field

thanks @toscho A quick tweak on toscho’s Remove Bio Box code add_action( ‘personal_options’, array ( ‘T5_Hide_Profile_Bio_Box’, ‘start’ ) ); /** * Captures the part with the biobox in an output buffer and removes it. * * @author Thomas Scholz, <[email protected]> * */ class T5_Hide_Profile_Bio_Box { /** * Called on ‘personal_options’. * * @return void */ … Read more

Restrict access to certain dashboard pages based on user id

I would just disable the editor entirely. It is a dangerous tool anyway. I compare it to working on an airplane while its flying. Edit wp-config.php to add: define(‘DISALLOW_FILE_EDIT’,true); You can reverse that by re-editing your wp-config.php and uploading over FTP (or maybe you have direct file access), as you should be doing anyway, but … Read more

Privacy in WordPress

You can combine these features by using the free versions of two plugins, Profile Builder that allows you to create a register form, the option of an admin approval and email confimation, login options; and Members that gives you control over which users (by role) have access to post content.