WordPress: Add custom add_filter for custom functions

You can use the apply_filters function: function koku_crm_send_sendgrid($sendgrid_api_key, $to, $subject, $text, $html) { $to = apply_filters( ‘koku_crm_send_to’, $to ); $sendgrid = new \SendGrid($sendgrid_api_key); $mail = new KCSendGrid\Mail(); $from = new KCSendGrid\Email(get_bloginfo( ‘name’ ), get_bloginfo( ‘admin_email’ )); $mail->setFrom($from); $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, ‘UTF-8’)); $content = new KCSendGrid\Content(“text/plain”, $text); $mail->addContent($content); $content = new KCSendGrid\Content(“text/html”, $html); $mail->addContent($content); $personalization = new … Read more

jQuery Click event is not fired at all

I Found the answer for my question , And I’m sharing it here in case anyone interested. the problem was that click event won’t work on dynamically generated html elements and the alternative that worked is using on $(‘body’).on(‘click’,’#elementID’,Callback)

woocommerce search by sku and title ajax

Pls Try this code if(is_numeric($search_keyword)){ $args = array( ‘posts_per_page’ => 3, ‘post_type’ => ‘product’, ‘meta_query’ => array( array( ‘key’ => ‘_sku’, ‘value’ => $search_keyword, ‘compare’ => ‘LIKE’ ) ) ); } else if(is_string($search_keyword)){ $args = array( ‘s’ => $search_keyword, ‘post_type’ => ‘product’, ‘post_status’ => ‘publish’, ‘ignore_sticky_posts’ => 1, ‘posts_per_page’ => 3, ‘orderby’ => $ordering_args[‘orderby’], ‘order’ … Read more