January 10, 2018

Replace your WordPress Avatar URL with ACF image field

Replace your WordPress Avatar URL with ACF image field add_filter(‘get_avatar_url’, ‘lb_acf_profile_avatar_url’, 10, 2); function lb_acf_profile_avatar_url($avatar, $id){ $image_id = get_user_meta($id, ‘lb_local_avatar’, true); if ( ! $image_id ) { return $avatar; } $image_url = wp_get_attachment_image_src( $image_id, ‘thumbnail’ ); $avatar = $image_url[0]; return $avatar; }

January 9, 2018

How to allow WooCommerce customers to add capability of image uploading to library?

How to allow WooCommerce customers to add capability of image uploading to library? add_action(‘admin_init’, ‘allow_customer_uploads’); function allow_customer_uploads(){ $customer = get_role(‘customer’); $customer->add_cap(‘upload_files’); }

How to use ACF Image field as WordPress user profile avatar?

How to use ACF Image field as WordPress user profile avatar? add_filter(‘get_avatar’, ‘lb_acf_profile_avatar’, 10, 5); function lb_acf_profile_avatar( $avatar, $id_or_email, $size, $default, $alt ) { $field_name = ‘lb_local_avatar’; $user = ”; // Get user by id or email if ( is_numeric( $id_or_email ) ) { $id = (int) $id_or_email; $user = get_user_by( ‘id’ , $id ); […]

Restrict users to view only their uploads while using ACF

Restrict users to view only their uploads while using ACF add_filter( ‘ajax_query_attachments_args’, ‘lb_show_current_user_attachments’ ); function lb_show_current_user_attachments( $query ) { $user_id = get_current_user_id(); if ( $user_id && !current_user_can(‘activate_plugins’) && !current_user_can(‘edit_others_posts ‘) ) { $query[‘author’] = $user_id; } return $query; }

October 29, 2017

WooCommerce – Please choose product options…

WooCommerce – Variable Product – Please choose product options… Situation: When you are using some custom template for single product (WooCommerce) and variation selection isn’t taking effect on click because your are using “do_action” with “woocommerce_before_add_to_cart_form” and “woocommerce_after_variations_form” maybe inside a shortcode? If yes, then WooCommerce is leaving your form as orphan and will not […]

September 11, 2017

Woo Coming Soon

WordPress Plugin WooCommerce

Woo Coming Soon can handle all of your needs with simply one button on edit product page.

July 29, 2017

Is there any way to send an email to admin?

Is there any way to send an email to admin when an order goes to pending payment while ordering by user in woo-commerce? Yes, it’s possible with the hook. Have a look here. WooCommerce – send custom email on custom order status change

July 24, 2017

WooCommerce Order Splitter

WordPress Plugin – WooCommerce Order Splitter