disable password protected page for logged users

Disable the post password protection for (some) users You can try the post_password_required filter (4.7+) to override it for logged in users: add_filter( ‘post_password_required’, function( $returned, $post ) { // Override it for logged in users: if( $returned && is_user_logged_in() ) $returned = false; return $returned; }, 10, 2 ); or disable it for users … Read more

Custom user role that can only edit specific (non-custom-type) page and all child pages [duplicate]

There’s no way in WordPress to assign the capability for editing (or any action) a specific post to a role. However, you can filter capabilities checks and change them on the fly using the map_meta_cap. When handling post permissions, WordPress ultimately deals in just 4 capabilties: edit_post read_post delete_post publish_post Then whenever an action is … Read more

How can i force Display names to be the same as Usernames?

You can use the wp_pre_insert_user_data filter. function wpse_filter_user_data( $data, $update, $id) { if( isset( $data[ ‘user_login’ ] ) ) { $data[ ‘display_name’ ] = $data[ ‘user_login’ ]; return $data; } $user = get_user_by( ’email’, $data[ ‘user_email’ ] ); $data[ ‘display_name’ ] = $user->user_login; return $data; } add_filter( ‘wp_pre_insert_user_data’, ‘wpse_filter_user_data’, 10, 3 ); You’ll probably want … Read more

How can I run a WP-CLI command as authenticated user?

By default WP-CLI executes every command as unauthenticated (logged-out) user. To execute a command as any existing WordPress user you can use the global –user parameter, which accepts an user ID, login, or email address. $ wp nurse check –all –user=1 You’ll get all other global parameters listed when running $ wp –help or $ … Read more

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