This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Send Email To unpaid/pending users via cron job wp (FF payment status = pending) | |
| /** | |
| * this method will register event to WordPress init | |
| */ | |
| add_action( 'init', 'sendEmailToPaymentPendingUsers'); | |
| function sendEmailToPaymentPendingUsers(){ | |
| if( !wp_next_scheduled( 'notify_unpaid_users' ) ) { | |
| // schedule an event | |
| //Available Event Types (hourly, twicedaily, daily, weekly, fifteendays, monthly) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'fluentform_response_render_input_password', function($response_field_key, $field, $formId, $isHtml){ | |
| $hash = str_repeat("*", strlen($response_field_key)).' '. __('(truncated)', 'fluentform'); | |
| return $hash; | |
| } , 10, 4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function get_total_amount() { | |
| $formApi = fluentFormApi('forms')->entryInstance($formId = 5); | |
| $entries = $formApi->entries(); | |
| $totalEntries = count($entries); | |
| $totalPaid=0; | |
| for($i=0; $i<$totalEntries; $i++){ | |
| if($entries['data'][$i]->payment_status === 'paid'){ | |
| $totalPaid+= (($entries['data'][$i]->payment_total)/100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('fluenform_rendering_field_data_select', function ($data, $form) { | |
| //Repleace the 44 with your form id | |
| if ($form->id != 44) { | |
| return $data; | |
| } | |
| // check if the name attriibute is 'dropdown' | |
| if (\FluentForm\Framework\Helpers\ArrayHelper::get($data, 'attributes.name') != 'dropdown') { | |
| return $data; | |
| } | |
| $feeds = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('fluentform_after_payment_status_change', 'emailNotification',10,2); | |
| function emailNotification($newStatus, $submission){ | |
| if($newStatus!='pending'){ | |
| $to = $submission->response['email']; // You set your email here | |
| $subject = 'Your order change to '. $submission->payment_status; | |
| $message = 'Hi '.$submission->response['names']['first_name'].','.'<br>'; | |
| $message.='Your order change to '. $submission->payment_status; | |
| } | |
| return wp_mail( $to, $subject, $message); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('fluentform_filter_email_attachments', function($emailAttachments, $notification,$form, $submittedData){ | |
| $target_form_id = 38; | |
| if($form->id != $target_form_id){ | |
| return; | |
| } | |
| $url = "your_file_location_url"; | |
| $tmp = download_url($url); | |
| if (is_wp_error($tmp)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $method = ['paypal','stripe']; | |
| foreach($method as $mode){ | |
| add_action('fluent_payment_frameless_'.$mode, 'afterPayment',10,1); | |
| } | |
| function afterPayment($data){ | |
| //$tansiction = FluentFormPro\Payments\PaymentMethods\BaseProcessor::getTransaction($data['transaction_hash'],'transaction_hash'); | |
| //dd($tansiction->status); | |
| /*if($data['type']== 'success' && $tansiction->status){ | |
| echo "<script> | |
| window.location.href='https://google.com'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('fluentform_response_render_input_number', function ($response, $field, $form_id, $isHtml = true) { | |
| if (!$response ) { | |
| return $response; | |
| } | |
| $fieldSettings = \FluentForm\Framework\Helpers\ArrayHelper::get($field, 'raw.settings'); | |
| $formatter = \FluentForm\Framework\Helpers\ArrayHelper::get($fieldSettings, 'numeric_formatter'); | |
| if (!$formatter) { | |
| return $response; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('fluentform_validation_message_phone_valid_phone_number', function($msg){ | |
| $msg = "Err"; | |
| return $msg; | |
| },10,1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('ninja_table_rendering_table_vars',function($table_vars, $table_id, $tableArray){ | |
| $target_id = [2607,2608]; | |
| $tableId = 0; | |
| foreach($target_id as $id){ | |
| if($table_id == $id){ | |
| $tableId = $id; | |
| } | |
| } |
OlderNewer