[buddypress-trac] [BuddyPress Trac] #9061: Rewrite Rules Built Even When Not Needed

buddypress-trac noreply at wordpress.org
Mon Jan 8 18:47:44 UTC 2024


#9061: Rewrite Rules Built Even When Not Needed
-------------------------+------------------------------
 Reporter:  sjregan      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Core         |     Version:  12.0.0
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------

Comment (by imath):

 Hi @sjregan

 I kind of disagree when you write:

 > Rewrite rules for components are built every page load, regardless of
 whether they are needed or not.

 Rewrite rules for built in components are only generated when you activate
 the component or when you customize slugs.

 If you’re talking about a custom component you can force this generation
 by firing `bp_delete_rewrite_rules()` once the plugin containing it is
 activated. Rewrite rules will then be generated at next front end page
 load.

 PS: When building a custom component, specifying it has a directory will
 generate the root `buddypress` post type as explained here:
 https://github.com/buddypress/buddypress/blob/master/docs/developer/component
 /build-component.md#parsing-requests-about-your-custom-add-on-directory

 That being said, if you have a better way to handle it, I’ll be happy to
 review a PR or a patch. Everything can be improved 😅

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


More information about the buddypress-trac mailing list