[buddypress-trac] [BuddyPress Trac] #3961: Hierarchical groups
buddypress-trac
noreply at wordpress.org
Tue Aug 9 18:27:43 UTC 2016
#3961: Hierarchical groups
------------------------------------+-----------------------
Reporter: sooskriszta | Owner: dcavins
Type: enhancement | Status: assigned
Priority: normal | Milestone: 2.7
Component: Groups | Version:
Severity: normal | Resolution:
Keywords: dev-feedback has-patch |
------------------------------------+-----------------------
Comment (by dcavins):
I think @r-a-y's invalidation scheme makes sense and wouldn't be costly.
If we must do it at upgrade, the simplest code is probably:
{{{#!php
<?php
function bp_update_to_2_7() {
bp_add_option( 'bp-emails-unsubscribe-salt', base64_encode(
wp_generate_password( 64, true, true ) ) );
/*
* Also handled by `bp_core_install()`.
* Add `parent_id` column to groups table.
*/
if ( bp_is_active( 'groups' ) ) {
bp_core_install_groups();
// Invalidate all cached group objects.
global $wpdb;
$bp = buddypress();
$group_ids = $wpdb->get_column( "SELECT id FROM
{$bp->groups->table_name}" );
foreach ( $group_ids as $group_id ) {
wp_cache_delete( $group_id, 'bp_groups' );
}
}
}
}}}
which seems pretty straightforward, but I don't know how efficient
`wp_cache_delete()` is. @r-a-y or @boonebgorges probably know something
about it. :)
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3961#comment:49>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list