Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/02/2024 07:12:25 PM (20 months ago)
Author:
espellcaste
Message:

WPCS: Part VIII: miscellaneous fixes for some of the files of the core component.

Follow-up to [13883], [13886], [13887], [13888], [13891], [13892], [13893]

See #9164 and #7228

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-core-notification.php

    r12753 r13900  
    8585    public function __construct( $id = 0 ) {
    8686
    87         // Bail if no ID
     87        // Bail if no ID.
    8888        if ( empty( $id ) ) {
    8989            return;
     
    9999     * @global wpdb $wpdb WordPress database object.
    100100     *
    101      * @return bool Success or failure.
     101     * @return bool
    102102     */
    103103    public function save() {
     
    111111            $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 );
    112112
    113         // Save.
     113            // Save.
    114114        } else {
    115115            $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 )";
     
    145145
    146146        if ( ! empty( $result ) ) {
    147             $this->item_id = $result->item_id;
     147            $this->item_id           = $result->item_id;
    148148            $this->secondary_item_id = $result->secondary_item_id;
    149149            $this->user_id           = $result->user_id;
     
    160160     * Check the access for a user.
    161161     *
     162     * @global wpdb $wpdb WordPress database object.
     163     *
    162164     * @param int $user_id         ID to check access for.
    163165     * @param int $notification_id Notification ID to check for.
     
    181183     * @global wpdb $wpdb WordPress database object
    182184     *
    183      * @static
    184      *
    185185     * @param int    $user_id User ID.
    186186     * @param string $status 'is_new' or 'all'.
     
    207207     *
    208208     * @global wpdb $wpdb WordPress database object.
    209      *
    210      * @static
    211209     *
    212210     * @param int    $user_id          ID of the user to delet notification for.
     
    232230     * @global wpdb $wpdb WordPress database object.
    233231     *
    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.
    242238     * @return mixed
    243239     */
     
    248244
    249245        $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 )
    251247            : '';
    252248
     
    262258     *
    263259     * @global wpdb $wpdb WordPress database object.
    264      *
    265      * @static
    266260     *
    267261     * @param int    $user_id          The ID of the user whose sent notifications we wish to delete.
     
    287281     *
    288282     * @global wpdb $wpdb WordPress database object.
    289      *
    290      * @static
    291283     *
    292284     * @param int    $item_id           The item id that they notifications are to be for.
     
    300292
    301293        $component_action_sql = ! empty( $component_action )
    302             ? $wpdb->prepare( "AND component_action = %s", $component_action )
     294            ? $wpdb->prepare( 'AND component_action = %s', $component_action )
    303295            : '';
    304296
    305297        $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 )
    307299            : '';
    308300
Note: See TracChangeset for help on using the changeset viewer.