Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/26/2014 06:08:03 AM (11 years ago)
Author:
r-a-y
Message:

Messages: Introduces meta table and related cache functions.

This commit alters the messages DB schema to add a meta table, which will
allow plugin developers to record information about a message.

The new message meta functions in bp-messages-functions.php mirrors those
in other BP components (activity, groups, etc.).

The DB version is also bumped to 9181.

See #3083.

File:
1 edited

Legend:

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

    r8479 r9182  
    1212// Exit if accessed directly
    1313if ( !defined( 'ABSPATH' ) ) exit;
     14
     15/**
     16 * Slurp up metadata for a set of messages.
     17 *
     18 * It grabs all message meta associated with all of the messages passed in
     19 * $message_ids and adds it to WP cache. This improves efficiency when using
     20 * message meta within a loop context.
     21 *
     22 * @since BuddyPress (2.2.0)
     23 *
     24 * @param int|str|array $message_ids Accepts a single message_id, or a
     25 *        comma-separated list or array of message ids.
     26 */
     27function bp_messages_update_meta_cache( $message_ids = false ) {
     28    bp_update_meta_cache( array(
     29        'object_ids'       => $message_ids,
     30        'object_type'      => buddypress()->messages->id,
     31        'cache_group'      => 'message_meta',
     32        'object_column'    => 'message_id',
     33        'meta_table'       => buddypress()->messages->table_name_meta,
     34        'cache_key_prefix' => 'bp_messages_meta'
     35    ) );
     36}
    1437
    1538// List actions to clear super cached pages on, if super cache is installed
Note: See TracChangeset for help on using the changeset viewer.