Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/18/2023 09:42:31 AM (13 months ago)
Author:
imath
Message:

BP Rewrites: start the migration process for the Groups component

  • Add rewrite tags & rules for the Groups directory type and the create URLs.
  • Introduce bp_get_group_url()/bp_group_url() & to retrieve/output a Groups single item URL using BP Rewrites.
  • Introduce bp_get_group_restricted_screens(), bp_get_group_extension_screens() & bp_get_group_screens() to get information about the Groups screens (in particular each screen rewrite ID). These functions will ease slug customizations from the BuddyPress URL settings tab.
  • Improve the Group creation process making sure it's using BP Rewrites to build URLs.
  • Perform easiest replacements for bp_get_group_permalink()/bp_group_permalink() & bp_get_groups_directory_permalink()/bp_groups_directory_permalink() in favor of bp_get_group_url()/bp_group_url() & bp_get_groups_directory_url()/bp_groups_directory_url()`.
  • Improve code formatting & properly escape single group URLs into templates.
  • Update impacted Unit Tests.

Props r-a-y, johnjamesjacoby, boonebgorges

Closes https://github.com/buddypress/buddypress/pull/75
See #4954

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/groups/functions.php

    r13433 r13437  
    562562        'slug'      => 'all', // slug is used because BP_Core_Nav requires it, but it's the scope
    563563        'li_class'  => array( 'selected' ),
    564         'link'      => bp_get_groups_directory_permalink(),
     564        'link'      => bp_get_groups_directory_url(),
    565565        'text'      => __( 'All Groups', 'buddypress' ),
    566566        'count'     => bp_get_total_group_count(),
     
    591591                'slug'      => 'create', // slug is used because BP_Core_Nav requires it, but it's the scope
    592592                'li_class'  => array( 'no-ajax', 'group-create', 'create-button' ),
    593                 'link'      => trailingslashit( bp_get_groups_directory_permalink() . 'create' ),
     593                'link'      => bp_get_groups_directory_url(
     594                    array(
     595                        'create_single_item' => 1,
     596                    )
     597                ),
    594598                'text'      => __( 'Create a Group', 'buddypress' ),
    595599                'count'     => false,
Note: See TracChangeset for help on using the changeset viewer.