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