|
@@ -40,17 +40,17 @@ discard block |
|
|
block discarded – undo |
|
40
|
40
|
public static function is_value_match( $field_value, $target_value, $operation = 'is', $source_field = null, $rule = null, $form = null ) { |
|
41
|
41
|
|
|
42
|
42
|
if ( in_array( $source_field, array( 'date_created', 'date_updated', 'payment_date' ), true ) ) { |
|
43
|
|
- $field_value = is_int( $field_value )? $field_value : strtotime( $field_value ); |
|
44
|
|
- $target_value = is_int( $target_value )? $target_value : strtotime( $target_value ); |
|
|
43
|
+ $field_value = is_int( $field_value ) ? $field_value : strtotime( $field_value ); |
|
|
44
|
+ $target_value = is_int( $target_value ) ? $target_value : strtotime( $target_value ); |
|
45
|
45
|
} |
|
46
|
46
|
|
|
47
|
47
|
if ( $source_field instanceof GF_Field && $source_field->type == 'date' ) { |
|
48
|
|
- $field_value = is_int( $field_value )? $field_value : strtotime( $field_value ); |
|
49
|
|
- $target_value = is_int( $target_value )? $target_value : strtotime( $target_value ); |
|
|
48
|
+ $field_value = is_int( $field_value ) ? $field_value : strtotime( $field_value ); |
|
|
49
|
+ $target_value = is_int( $target_value ) ? $target_value : strtotime( $target_value ); |
|
50
|
50
|
} |
|
51
|
51
|
|
|
52
|
52
|
if ( in_array( $_operation = str_replace( ' ', '_', trim( $operation ) ), array( 'in', 'not_in' ) ) ) { |
|
53
|
|
- return GVCommon::matches_operation( (array) $field_value, (array) $target_value, $_operation ); |
|
|
53
|
+ return GVCommon::matches_operation( (array)$field_value, (array)$target_value, $_operation ); |
|
54
|
54
|
} |
|
55
|
55
|
|
|
56
|
56
|
return parent::is_value_match( $field_value, $target_value, $operation, $source_field, $rule, $form ); |
|
@@ -74,18 +74,18 @@ discard block |
|
|
block discarded – undo |
|
74
|
74
|
|
|
75
|
75
|
$post_data = self::get_post_fields( $form, $entry ); |
|
76
|
76
|
|
|
77
|
|
- $media = get_attached_media( 'image', $entry['post_id'] ); |
|
|
77
|
+ $media = get_attached_media( 'image', $entry[ 'post_id' ] ); |
|
78
|
78
|
|
|
79
|
79
|
$post_images = array(); |
|
80
|
80
|
|
|
81
|
81
|
foreach ( $media as $media_item ) { |
|
82
|
|
- foreach( (array) $post_data['images'] as $post_data_item ) { |
|
83
|
|
- if( |
|
|
82
|
+ foreach ( (array)$post_data[ 'images' ] as $post_data_item ) { |
|
|
83
|
+ if ( |
|
84
|
84
|
\GV\Utils::get( $post_data_item, 'title' ) === $media_item->post_title && |
|
85
|
85
|
\GV\Utils::get( $post_data_item, 'description' ) === $media_item->post_content && |
|
86
|
86
|
\GV\Utils::get( $post_data_item, 'caption' ) === $media_item->post_excerpt |
|
87
|
87
|
) { |
|
88
|
|
- $post_images["{$post_data_item['field_id']}"] = $media_item->ID; |
|
|
88
|
+ $post_images[ "{$post_data_item[ 'field_id' ]}" ] = $media_item->ID; |
|
89
|
89
|
} |
|
90
|
90
|
} |
|
91
|
91
|
} |
|
@@ -113,7 +113,7 @@ discard block |
|
|
block discarded – undo |
|
113
|
113
|
* If the method changes to public, use Gravity Forms' method |
|
114
|
114
|
* @todo: If/when the method is public, remove the unneeded copied code. |
|
115
|
115
|
*/ |
|
116
|
|
- if( $reflection->isPublic() ) { |
|
|
116
|
+ if ( $reflection->isPublic() ) { |
|
117
|
117
|
return parent::get_post_fields( $form, $entry ); |
|
118
|
118
|
} |
|
119
|
119
|
|
|
@@ -140,7 +140,7 @@ discard block |
|
|
block discarded – undo |
|
140
|
140
|
* If the method changes to public, use Gravity Forms' method |
|
141
|
141
|
* @todo: If/when the method is public, remove the unneeded copied code. |
|
142
|
142
|
*/ |
|
143
|
|
- if( $reflection->isPublic() ) { |
|
|
143
|
+ if ( $reflection->isPublic() ) { |
|
144
|
144
|
return parent::copy_post_image( $url, $post_id ); |
|
145
|
145
|
} |
|
146
|
146
|
|
|
@@ -175,7 +175,7 @@ discard block |
|
|
block discarded – undo |
|
175
|
175
|
* If the method changes to public, use Gravity Forms' method |
|
176
|
176
|
* @todo: If/when the method is public, remove the unneeded copied code. |
|
177
|
177
|
*/ |
|
178
|
|
- if( $reflection->isPublic() ) { |
|
|
178
|
+ if ( $reflection->isPublic() ) { |
|
179
|
179
|
return parent::media_handle_upload( $url, $post_id, $post_data ); |
|
180
|
180
|
} |
|
181
|
181
|
|