Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2014 02:58:50 AM (12 years ago)
Author:
boonebgorges
Message:

Migrate groupmeta functions to the WP metadata API

See #4551

Props boonebgorges, johnjamesjacoby

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-filters.php

    r7741 r7840  
    530530}
    531531add_filter( 'wp_setup_nav_menu_item', 'bp_setup_nav_menu_item', 10, 1 );
     532
     533/**
     534 * Filter SQL query strings to swap out the 'meta_id' column.
     535 *
     536 * WordPress uses the meta_id column for commentmeta and postmeta, and so
     537 * hardcodes the column name into its *_metadata() functions. BuddyPress, on
     538 * the other hand, uses 'id' for the primary column. To make WP's functions
     539 * usable for BuddyPress, we use this just-in-time filter on 'query' to swap
     540 * 'meta_id' with 'id.
     541 *
     542 * @since BuddyPress (2.0.0)
     543 *
     544 * @access private Do not use.
     545 *
     546 * @param string $q SQL query.
     547 * @return string
     548 */
     549function bp_filter_metaid_column_name( $q ) {
     550    return str_replace( 'meta_id', 'id', $q );
     551}
Note: See TracChangeset for help on using the changeset viewer.