Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/01/2015 05:22:59 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Notifications: Introduce notification metadata table.

  • Bump DB version
  • Introduce DB upgrade function & routine for 2.3.0
  • Add metadata table to Notifications installation function
  • Add metadata CRUD functions to Notifications component

See #6257.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-notifications/bp-notifications-cache.php

    r9352 r9572  
    66 * @since BuddyPress (2.0.0)
    77 */
     8
     9/**
     10 * Slurp up metadata for a set of notifications.
     11 *
     12 * It grabs all notification meta associated with all of the notifications
     13 * passed in $notification_ids and adds it to WP cache. This improves efficiency
     14 * when using notification meta within a loop context.
     15 *
     16 * @since BuddyPress (2.3.0)
     17 *
     18 * @param int|str|array $notification_ids Accepts a single notification_id, or a
     19 *                                        comma-separated list or array of
     20 *                                        notification ids.
     21 */
     22function bp_notifications_update_meta_cache( $notification_ids = false ) {
     23    bp_update_meta_cache( array(
     24        'object_ids'       => $notification_ids,
     25        'object_type'      => buddypress()->notifications->id,
     26        'cache_group'      => 'notification_meta',
     27        'object_column'    => 'notification_id',
     28        'meta_table'       => buddypress()->notifications->table_name_meta,
     29        'cache_key_prefix' => 'bp_notifications_meta'
     30    ) );
     31}
    832
    933/**
Note: See TracChangeset for help on using the changeset viewer.