Skip to content

Commit e616657

Browse files
authored
Create gform_get_form_filter_13
// فقط یکبار ارسال کرده باشند
1 parent dc28897 commit e616657

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

gform_get_form_filter_13

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// فقط یکبار ارسال کرده باشند
2+
دیگر نمیتونن فرم را ارسال کنن تا از صندوق پاک بشه
3+
<?php
4+
add_filter( 'gform_get_form_filter_13', 'custom_schedule', 10, 2 );
5+
function custom_schedule( $form_string, $form ) {
6+
7+
$current_user = wp_get_current_user();
8+
9+
$search_criteria = array(
10+
'status' => 'active',
11+
'field_filters' => array( //which fields to search
12+
array(
13+
'key' => 'created_by', 'value' => $current_user->ID, //Current logged in user
14+
)
15+
)
16+
);
17+
$form_id = 13;
18+
$entry = GFAPI::get_entries($form_id,$search_criteria);
19+
20+
if ( !empty($entry) ) {
21+
$form_string = '<p> شما قبلا عکس خود را ارسال کرده اید. در صورت تغییر با کانون پویان تماس بگیرید</p>';
22+
}
23+
return $form_string;
24+
}
25+
?>

0 commit comments

Comments
 (0)