Skip to:
Content

BuddyPress.org

Changeset 11293


Ignore:
Timestamp:
12/12/2016 11:28:17 PM (8 years ago)
Author:
slaffik
Message:

Messages: New filters in BP_Messages_Notice class.

Provide several new filters and actions for different methods, that give ability for plugin developers to further fine-tune Notices in Messages component.

See #5193.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/classes/class-bp-messages-notice.php

    r11268 r11293  
    197197        }
    198198
     199        /**
     200         * Fires after the current message item has been deleted.
     201         *
     202         * @since 2.8.0
     203         *
     204         * @param BP_Messages_Notice $this Current instance of the message notice item being deleted.
     205         */
     206        do_action( 'messages_notice_after_delete', $this );
     207
    199208        return true;
    200209    }
     
    239248        }
    240249
    241         return $notices;
     250        /**
     251         * Filters the array of notices, sorted by date and paginated.
     252         *
     253         * @since 2.8.0
     254         *
     255         * @param array $r Array of parameters.
     256         */
     257        return apply_filters( 'messages_notice_get_notices', $notices, $r );
    242258    }
    243259
     
    256272        $notice_count = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->messages->table_name_notices}" );
    257273
    258         return $notice_count;
     274        /**
     275         * Filters the total number of notices.
     276         *
     277         * @since 2.8.0
     278         */
     279        return (int) apply_filters( 'messages_notice_get_total_notice_count', $notice_count );
    259280    }
    260281
     
    280301        }
    281302
    282         return $notice;
     303        /**
     304         * Gives ability to filter the active notice that should be displayed on the front end.
     305         *
     306         * @since 2.8.0
     307         */
     308        return apply_filters( 'messages_notice_get_active', $notice );
    283309    }
    284310}
Note: See TracChangeset for help on using the changeset viewer.