allow user to create a draft post but not publish wordpress

Use wp_insert_post_data filter. Then check the user role. If user have specific role set-up post status. ( I don’t test below script) add_filter( ‘wp_insert_post_data’, ‘filter_handler’, ’99’); function filter_handler( $data ) { $user = wp_get_current_user(); $userRole = $user->roles ? $user->roles[0] : false; if ( $userRole === ‘author’) { $data[‘post_status’] = ‘pending’; } return $data; }

Allow editor user to full permission to access plugin settings

This is a problem with the original plugin. They obviously never actually tested this filter. They have used the mc4wp_admin_required_capability to control whether the admin page is accessible, but WordPress still prevents you saving settings unless this filter is also used: https://developer.wordpress.org/reference/hooks/option_page_capability_option_page You should contact the plugin author and ask them to fix this, but … Read more

Change role in maintenance mode

Login as admin to my-wordpress-site/wp-admin. Go to Plugins -> WP Maintenance Mode -> Settings. Add a role to Backend Roles. To create a new role for maintenance use https://wordpress.org/plugins/user-role-editor/. User Role editor can create copies of existing roles.

grant multiple roles access to specific admin menu item

You shouldn’t use Roles to handle permissions for your menu page. Instead, use capabilities, and then assign those capabilities to whichever roles should have access. For example, instead of creating a customrole role, use a custom capability like manage_custom_plugin: add_menu_page( ‘Custom-Plugin’, ‘Custom-Plugin’, ‘manage_custom_plugin’, ‘custom-plugin’, ‘init_custom_menu_page’ ); Now, using the Members plugin you can enter manage_custom_plugin … Read more

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