Want to add Number of Products added by each shop manager in users list

you can use this code. It shows the number of products of each user, exactly what you wanted!!! // create tab row in users page add_filter( ‘manage_users_columns’, ‘pre_modify_user_table’ ); function pre_modify_user_table( $column ) { $column[‘pCount’] = ‘product count’; return $column; } // display user product count add_filter( ‘manage_users_custom_column’, ‘pre_modify_user_table_row’, 10, 3 ); function pre_modify_user_table_row( $val, … Read more

Filter and manipulate the get_current_user() function

From what I’m seeing in the github repo. get_current_user doesn’t exist. What you do have is wp_get_current_user, this function does this return _wp_get_current_user(); So now I checked what _wp_get_current_user does. It checks a global variable $global_user, if it’s not empty, return an instance of it (didn’t find any actions for that). If empty it does … Read more

How to add custom detail page for a Subscriber at Admin Panel

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

How do I count the number of pages a user has seen on my site, and force them to log in after a certain amount

Background Gating unauthenticated end-user’s ability to view site content based on the activity of such users is a difficult problem to solve reliably, owed to the design of web technologies as a whole. To the best of my knowledge, WordPress core provides no features which require any such functionality, and so there are no core … Read more

How to display Most Recently Read 10 Posts by a logged in user in wordpress

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

Why does a super admin on multi site get a rest_user_invalid_id error code when requesting user details through REST?

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

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