Pawan Kumawat

WooCommerce: Display Regular & Sale Price @ Cart Table

Learn how to enhance your WooCommerce cart table by displaying both the regular and sale prices. Implement this functionality using WordPress hooks and filters to provide clear and appealing pricing information to your customers, encouraging sales and improving the shopping experience.

How to configure WordPress Auth Cookie Expiration

A 2021 IBM study found that 95% of cyber security breaches result from human error, meaning that eliminating mistakes makes your website more secure. Configuring WordPress Auth Cookie Expiration on your site eliminates the most basic human errors — forgetting to sign out from a user account with immense privileges. All human errors are often basic and look stupid in retrospect, but they can be very costly. Websites can significantly reduce their exposure to cybersecurity threats by automatically signing out logged-in users after a set period of inactivity by automatically signing out logged-in users after a set period of inactivity. But how do you implement a WordPress auth cookie to log users out automatically? Configuring WordPress Auth Cookie Expiration Cookie Every website provider and CMS system acknowledges the risks of logged-in users with critical member permissions. The industry developed various ways to log users out automatically after continued inactivity. First

Show Last login Time Of User In WordPress

How to display Quickly a WordPress user’s last login with custom code . Actually some time  we need to know our active users of site. so we can differentiate which user hasn’t logged in for a while. This is combination  4-5 hooks. 1: First we can use wp_login hook for saving login time and date. <?php //Record user’s last login to custom meta field add_action( ‘wp_login’, ‘custum_wp_login’, 10, 2 ); function custum_wp_login( $user_login, $user ) { update_user_meta( $user->ID, ‘custum_last_login’, date(‘Y-m-d H:i:s’)); }   2: Second we need to add column in user table to show last login <?php //Register new custom column with last login time add_filter( ‘manage_users_columns’, ‘custum_manage_users_columns’); add_filter(‘manage_users_custom_column’, ‘custum_manage_users_custom_column’, 10, 3); function custum_manage_users_columns( $columns ) { $columns[‘custum_last_login’] = __(‘Last login’, ‘last_login’); return $columns; } function custum_manage_users_custom_column( $value, $column_name, $user_id ) { if ( ‘custum_last_login’ == $column_name){ $last_login = get_user_meta( $user_id, ‘custum_last_login’, true ); $value = date(“g:i a –

Add Custom Product Data Tab

Learn how to enhance your WooCommerce product editor by adding a custom product data tab. Follow a step-by-step guide using the woocommerce_product_data_tabs filter and the woocommerce_product_data_panels action. Create a custom tab with your desired label, and include your own fields or content within the panel. Customize your product data to collect and display additional information, providing a tailored experience for your WooCommerce products.

How to know “Who created this coupon?”

What to do when your client ask “Who created this coupon?” . in WooCommerce.  But we don’t have any default things in WooCommerce  which automatically show author of coupon .

How To Add Menu In WordPress Admin Panel

How to add menu in WordPress admin panel – In this post we see how we can add custom menu to admin sidebar. Sometimes when we on WordPress and we need to show some features or any information in admin page then we can use this code snippet to create the same.

How To Limit Search To Post Titles?

I added a text field to the posts filter form and I use s= parameter to make the search work. But how to search only in the title of the post (not in the content)? how to limit search to post titles? How to search only by Post Title?

Categories