- Timestamp:
- 06/02/2024 07:12:25 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-core-notification.php
r12753 r13900 85 85 public function __construct( $id = 0 ) { 86 86 87 // Bail if no ID 87 // Bail if no ID. 88 88 if ( empty( $id ) ) { 89 89 return; … … 99 99 * @global wpdb $wpdb WordPress database object. 100 100 * 101 * @return bool Success or failure.101 * @return bool 102 102 */ 103 103 public function save() { … … 111 111 $sql = $wpdb->prepare( $query, $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id ); 112 112 113 // Save.113 // Save. 114 114 } else { 115 115 $query = "INSERT INTO {$bp->notifications->table_name} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, %s, %d )"; … … 145 145 146 146 if ( ! empty( $result ) ) { 147 $this->item_id = $result->item_id;147 $this->item_id = $result->item_id; 148 148 $this->secondary_item_id = $result->secondary_item_id; 149 149 $this->user_id = $result->user_id; … … 160 160 * Check the access for a user. 161 161 * 162 * @global wpdb $wpdb WordPress database object. 163 * 162 164 * @param int $user_id ID to check access for. 163 165 * @param int $notification_id Notification ID to check for. … … 181 183 * @global wpdb $wpdb WordPress database object 182 184 * 183 * @static184 *185 185 * @param int $user_id User ID. 186 186 * @param string $status 'is_new' or 'all'. … … 207 207 * 208 208 * @global wpdb $wpdb WordPress database object. 209 *210 * @static211 209 * 212 210 * @param int $user_id ID of the user to delet notification for. … … 232 230 * @global wpdb $wpdb WordPress database object. 233 231 * 234 * @static 235 * 236 * @param int $user_id The ID of the user who the notifications are for. 237 * @param int $item_id The item ID of the notifications we wish to delete. 238 * @param string $component_name The name of the component that the notifications we wish to delete. 239 * @param string $component_action The action of the component that the notifications we wish to delete. 240 * @param int $secondary_item_id (optional) The secondary item id of the notifications that we wish to 241 * use to delete. 232 * @param int $user_id The ID of the user who the notifications are for. 233 * @param int $item_id The item ID of the notifications we wish to delete. 234 * @param string $component_name The name of the component that the notifications we wish to delete. 235 * @param string $component_action The action of the component that the notifications we wish to delete. 236 * @param int $secondary_item_id (optional) The secondary item id of the notifications that we wish to 237 * use to delete. 242 238 * @return mixed 243 239 */ … … 248 244 249 245 $secondary_item_sql = ! empty( $secondary_item_id ) 250 ? $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id )246 ? $wpdb->prepare( ' AND secondary_item_id = %d', $secondary_item_id ) 251 247 : ''; 252 248 … … 262 258 * 263 259 * @global wpdb $wpdb WordPress database object. 264 *265 * @static266 260 * 267 261 * @param int $user_id The ID of the user whose sent notifications we wish to delete. … … 287 281 * 288 282 * @global wpdb $wpdb WordPress database object. 289 *290 * @static291 283 * 292 284 * @param int $item_id The item id that they notifications are to be for. … … 300 292 301 293 $component_action_sql = ! empty( $component_action ) 302 ? $wpdb->prepare( "AND component_action = %s", $component_action )294 ? $wpdb->prepare( 'AND component_action = %s', $component_action ) 303 295 : ''; 304 296 305 297 $secondary_item_sql = ! empty( $secondary_item_id ) 306 ? $wpdb->prepare( "AND secondary_item_id = %d", $secondary_item_id )298 ? $wpdb->prepare( 'AND secondary_item_id = %d', $secondary_item_id ) 307 299 : ''; 308 300
Note: See TracChangeset
for help on using the changeset viewer.