Redirect admin 403 “Cheatin uh?” admin pages

Sounds like this is what you’re running into. admin_page_access_denied may be the hook you want to use for this. try function dont_show_cheatin_page() { if ( current_user_can( ‘do_not_allow’ ) ) { wp_safe_redirect( admin_url()); // custom redirect instead of Cheatin 403 page exit; } } add_action(‘admin_page_access_denied’, ‘dont_show_cheatin_page’);

Change users.php WP_User_Query

pre_get_users is the action that is fired before a user query is run. You need to check the context of the action to make sure you’re on the main users screen. You can then alter the query with any parameters accepted by WP_User_Query. A quick example: function wpd_filter_users( $query ) { $screen = get_current_screen(); if( … Read more

Show global Message in User Profiles with admin only Input field in WordPress Backend

You just need to move the capability check “inwards”: function wpse_230369_quote_of_the_day( $user ) { $quote = esc_attr( get_option( ‘quote_of_the_day’ ) ); ?> <div class=”visible-only-for-admin”> <h3>Quote of the Day Input Field</h3> <table class=”form-table” > <tr> <th><label for=”quote_of_the_day”>Quote of the Day</label></th> <td> <?php if ( current_user_can( ‘administrator’ ) ) : ?> <input type=”text” name=”quote_of_the_day” value=”<?php echo $quote … Read more

Groups and subgroups for permission

First you need to make group and subgroup. You can use wordpress existing User Role or you can make custom user role (group) by own. Members is a nice plugin to create custom role. For example your main group is “Group1” and subgroup is “Subgroup1”. First you need to check current user role (Group of … Read more

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