[buddypress-trac] [BuddyPress Trac] #7984: Core multisite changes require mods to BP

buddypress-trac noreply at wordpress.org
Mon Mar 30 16:04:52 UTC 2020


#7984: Core multisite changes require mods to BP
------------------------------+---------------------
 Reporter:  boonebgorges      |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  6.0.0
Component:  Blogs             |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+---------------------
Changes (by boonebgorges):

 * keywords:  has-patch 2nd-opinion => has-patch commit


Comment:

 Thanks for working on this, @imath.

 It's a shame to have to introduce all of this infrastructure just so that
 we can support both versions without deprecation notices, when we'll
 probably drop support for < 5.1 in one of the next few major BP releases.
 Mais c'est la vie :)

 I want to make the following observations clear, for the sake of
 posterity.

 1. The weird function signatures for the `bp_insert_site()` and
 `bp_delete_site()` functions help to ensure that (a) we can accept
 arguments from the new WP hooks, while (b) continuing to pass the legacy
 arguments to our new hooks. This means less internal refactoring (eg, we
 don't have to rewrite `bp_blogs_remove_blog()` to accept WP's new filter
 args) as well as easier swap-outs for BP plugin developers who want to
 move away from WP's legacy hooks.

 2. The `bp_insert_site_hook()` and `bp_delete_site_hook()` functions will,
 after we update the minimum WP version to 5.1, always return the new hook
 names. At that time, we may want to clarify the inline docs a bit - we
 probably won't be able to remove the functions altogether, but it'll be
 helpful for future developers to have clear explanations of this part of
 the codebase that is essentially temporary.

 3. The `bp_delete_site_no_tables_drop()` trick reflects the fact the old
 `wpmu_delete_blog()` function had two different users: (a) to mark a site
 `deleted` in the database, or to drop the tables from the database. In WP
 5.1+, the operations are separate: `wp_update_site()` is used to set a
 site to `deleted`, while `wp_delete_site()` is used to drop database
 tables. For compatibility with the previous behavior of the `delete_blog`
 hook (where BP removes its blog-related data regardless of whether we're
 in situation (a) or (b)) we need to have two different callbacks.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7984#comment:11>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list