Insert query not working for non-logged in user
Insert query not working for non-logged in user
Insert query not working for non-logged in user
I found an answer. It is because the WooCommerce plugin which prevents users without edit_posts capability to display dashboard. Well, I think they should let you know that they are making this kind of change in WordPress default settings. Because you are not able to turn it off in WooCommerce settings.
I would hook into user_register similarly to how you hooked into gform_post_submission_1 before. For example: add_action( ‘user_register’, ‘awesome_function_name’, 10, 1 ); function awesome_function_name( $user_id ) { // Conditional logic for testing user role update_user_meta( $user_id, ‘dokan_enable_selling’, ‘yes’ ); } For your conditional logic, if you’re trying to make every role do this except customer I … Read more
Yes, the links will always be accessible unless you disable them on your htaccess or a PHP file. If you don’t have any author page, probably the users (or bots) that are reaching this page are seeing your index page. I highly recommend you install Google Analytics code on your website to track what your … Read more
After some further research I have used WP_List_Table class for this. I had to add buttons and links myself to make it look like users.php but it wasn’t much of work.
Ok i solved with this way: // Redirect guest users function login_redirect() { global $pagenow; // If user is not loged in and not in the login page if(!is_user_logged_in() && $pagenow != ‘wp-login.php’) auth_redirect(); } add_action( ‘wp’, ‘login_redirect’ );
First, you should know that current_user_can() only accepts capabilities, not roles, so you are using it wrong and you can end up with unexpected results. That being said, to exlude users form WP_User_Query you can use the exclude parameter: // Get current user data $user = wp_get_current_user(); // Check if current user is a subscriber … Read more
Resend user activation mail
Thanks Kerzzy, This worked more or less, though I needed to add this right after the opening php tag: /** * * Template Name: Change Password Template */ // fix buffering issue ob_start(); I encountered two issues and the above code fixed those problems. I couldn’t set my page to use this new template without … Read more
Because you need to give your function a parameter: function auto_follow_admin( $user_id ) { // Now you can use $user_id, which is passed to the function from the hook caller }