Enable comments for post when comments meta box removed

Filter the ‘comments_open’ check. It happens inside of the function with the same name, and that function is called in a theme usually like this: comments_open() and comment_form( array ( ‘comment_notes_after’ => ” ) ); This is how the filter works: add_filter( ‘comments_open’, ‘wpse_98775_comment_check’, 10, 2 ); function wpse_98775_comment_check( $open, $post_id ) { if ( … Read more

Admin user roles/permissions

The “Contributor” role has very little access to anything on the back end but can created posts. delete_posts edit_posts read http://codex.wordpress.org/Roles_and_Capabilities#Contributor For comparison, an ordinary “Subscriber” has the last of the three, so “Contributor” has only two extra capabilities. I am not quite sure what “access to specific plugins” means exactly but I am nearly … Read more

Change User Role based on Point System Issue

You have to remove the previous role first, then add the new role like $u = new WP_User( $user_ID); $role_of_user= $u->roles[0]; $u->remove_role($role_of_user); $u->add_role(‘new_role’); If user has more than 1 role then $u = new WP_User( $user_ID); foreach($u->roles as $role){ $u->remove_role($role); } $u->add_role(‘new_role’);

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