determine active user browser at the same time
determine active user browser at the same time
determine active user browser at the same time
function redirect_non_vendors() { global $wp; $user = wp_get_current_user(); $role_needed = ‘vendor’; $page_to_check = ‘secret/page/url’; $redirect_url = home_url( ‘/go-here/’ ); if ( ! in_array( $role_needed, (array) $user->roles ) && $page_to_check === $wp->request ) { wp_redirect( $redirect_url ); exit; } } add_action( ‘template_redirect’, ‘redirect_non_vendors’ ); You’ll want to replace three things here: vendor: the role that someone … Read more
WordPress – Security Question at Login from User’s Meta Data
Add custom input field in new user page
Show only users with the same role in Dashboard user list
current_user_can() returning true for capability when the user and role do not have the capability
Increase by one the user counter on specific role
It sounds like maybe you need to add a settings page, (https://developer.wordpress.org/plugins/settings/custom-settings-page/) This would be good if you had something really custom (customer user meta) and a layout that you wanted to keep separate from the regular user pages. Otherwise, why not just link to the core wordpress user pages? Just build your links like … Read more
At first you need to set a meta value when a post is visited using this way if( is_user_logged_in() ) { update_post_meta( $post_id, ‘post_readed_by’, get_current_user_id() ); } Then you can get the recent visited posts <?php $args = array( ‘posts_per_page’ => 10, ‘meta_key’ => ‘post_readed_by’, ‘meta_value’ => get_current_user_id(), ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ); … Read more
Deleting users with the REST API isn’t supported for multisite, as seen in the source code: // We don’t support delete requests in multisite. if ( is_multisite() ) { return new WP_Error( ‘rest_cannot_delete’, __( ‘The user cannot be deleted.’ ), array( ‘status’ => 501 ) ); } For GET requests the user ID is checked … Read more