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

Redirect authors from upload.php url to Home page in Multisite

If I understand you, he hook you want (WordPress 3.5.1) is load-upload.php. Proof of concept: function t_wpse_94284() { wp_redirect(home_url()); exit; } add_action(‘load-upload.php’,’t_wpse_94284′); That hook should fire only on /wp-admin/upload.php and, though I haven’t tested it, I think that your function should work just fine as it is.

User registration add user ID?

You can’t add the ID at registration because there is no ID until after the user has registered. (See a possible way around this near the bottom). You could tack on the ID after the registration with the user_register hook. function add_ID_wpse_99390($a) { global $wpdb; $user = new WP_User($a); $wpdb->query(“UPDATE {$wpdb->users} SET user_login = CONCAT(user_login,’_’,ID) … Read more

Delete old post with new post

If i understand the question correctly, you want that whenever a user adds a new post, all his/her previous posts should be deleted. I wonder why would you do that!! 🙂 But anyway, you can use this code. add_action(‘save_post’, ‘delete_prev_posts_by_user’, 10, 2 ); function delete_prev_posts_by_user( $post_id, $post ){ if( ‘publish’ == $post->post_status ){ $the_special_category_id = … Read more

delete user not working

WordPress should give this option below Attribute all posts to: Anyhow, I wrote a post on this (Clean Comments Table After User Deleted) Edit Also, you can move your all posts from deleted users to admin user. global $wpdb; $admin_id = 1; // Assign admin user id here $posts_table = $wpdb->prefix . ‘posts’; $users_table = … Read more

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