- Timestamp:
- 02/22/2022 06:54:08 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/classes/class-bp-notifications-notification.php
r13184 r13243 934 934 $conditions[] = "{$field} IN ({$_items})"; 935 935 936 foreach ( $update_args['data'] as $ field => $value ) {937 $index = array_search( $ field, array_keys( $update_args['data'] ) );936 foreach ( $update_args['data'] as $update_field => $value ) { 937 $index = array_search( $update_field, array_keys( $update_args['data'] ) ); 938 938 $format = $update_args['format'][ $index ]; 939 939 940 $fields[] = "{$ field} = {$format}";940 $fields[] = "{$update_field} = {$format}"; 941 941 $values[] = $value; 942 942 } 943 943 944 foreach ( $where_args['data'] as $ field => $value ) {945 $index = array_search( $ field, array_keys( $where_args['data'] ) );944 foreach ( $where_args['data'] as $where_field => $value ) { 945 $index = array_search( $where_field, array_keys( $where_args['data'] ) ); 946 946 $format = $where_args['format'][ $index ]; 947 947 948 $conditions[] = "{$ field} = {$format}";948 $conditions[] = "{$where_field} = {$format}"; 949 949 $values[] = $value; 950 950 } … … 952 952 $fields = implode( ', ', $fields ); 953 953 $conditions = implode( ' AND ', $conditions ); 954 955 if ( 'item_id' === $field && isset( $where_args['data']['user_id'] ) ) { 956 $where_args['item_ids'] = $items; 957 $where_args['user_id'] = $where_args['data']['user_id']; 958 } elseif ( 'id' === $field ) { 959 $where_args['ids'] = $items; 960 } 954 961 955 962 /** This action is documented in bp-notifications/classes/class-bp-notifications-notification.php */ … … 1022 1029 $conditions[] = "{$field} IN ({$_items})"; 1023 1030 1024 foreach ( $where['data'] as $ field => $value ) {1025 $index = array_search( $ field, array_keys( $where['data'] ) );1031 foreach ( $where['data'] as $where_field => $value ) { 1032 $index = array_search( $where_field, array_keys( $where['data'] ) ); 1026 1033 $format = $where['format'][ $index ]; 1027 1034 1028 $conditions[] = "{$ field} = {$format}";1035 $conditions[] = "{$where_field} = {$format}"; 1029 1036 $values[] = $value; 1030 1037 } 1031 1038 1032 1039 $conditions = implode( ' AND ', $conditions ); 1040 1041 if ( 'id' === $field ) { 1042 $args['id'] = $items; 1043 } 1033 1044 1034 1045 /** This action is documented in bp-notifications/classes/class-bp-notifications-notification.php */
Note: See TracChangeset
for help on using the changeset viewer.