No one can edit post/pages by Administrator
Download User Role Editor and uncheck the edit others post
Download User Role Editor and uncheck the edit others post
For the dashboard case. if ( !current_user_can(‘manage_options’) ) { function remove_dashboard_widgets() { // remove WooCommerce Dashboard Status remove_meta_box( ‘woocommerce_dashboard_status’, ‘dashboard’, ‘normal’); } add_action(‘wp_user_dashboard_setup’, ‘remove_dashboard_widgets’, 20); add_action(‘wp_dashboard_setup’, ‘remove_dashboard_widgets’, 20); }
In your single.php template file: <?php if (has_post()) { the_post(); $user = wp_get_current_user(); $hasPermission = in_array(‘subscriber’, $user->roles); // or maybe instead of a role, you can check for your custom permission: // $hasPermission = current_user_can(‘view_access_codes’); $postTime = get_post_time(‘U’, true); $timeThreshold = time() – 60 * 60 * 1.5; $hasTimePassed = $postTime < $timeThreshold; if (!$hasPermission … Read more
WP_User_Query is a user search. This sentence… But I need to echo only those users name whose meta_key= something but meta _value is equal to current user ID. … suggests that that is not really what you want. I think you can accomplish this with: $current_user = wp_get_current_user(); $meta = get_user_meta($current_user->ID, ‘Something’, true); if (!empty($meta)) … Read more
It looks like $current_user->user_firstname contains some tag content. I would replace that line with: <h5>Hi <?php echo esc_html($current_user->user_firstname); ?></h5> or <h5>Hi <?php echo strip_tags($current_user->user_firstname); ?></h5> One of those (or either) may solve your problem outright.
If you want to completely disable the user from editing their profile, you can remove the user profile page. See a similar question here: disallow user from editing their own profile information.
Maybe start searching for plugins like Wishlist-Member, its description will give you the jargon and wordpress-specific ideas you’ll need to better refine your search and move forward in your solution.
First thing is to grab the last order ID, you can do it with a simple WP_Query $args = array(‘post_type’=>’product’, ‘posts_per_page’=>1, ‘orderby’=>’ID’, ‘orderby’=>’DESC’); $query= WP_Query($args); As this will only give only one result, you don’t need to loop the result, $order_id= $query->posts[0]->ID; Now, you can reach the order data, $order = WC_Order($order_id); You can use … Read more
WP doesn’t have a built-in way to restrict permissions this granularly. You can either install plugins, or not. For settings, it depends on where the plugin surfaces its settings. For example, if the settings are under the “Settings” menu, then by default only users with role “administrator” will be able to access and adjust them. … Read more
For Fb Login/Registration, Read The Article link Given here