Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/15/2023 08:16:46 AM (13 months ago)
Author:
imath
Message:

Make more BuddyPress generated links ready for BP Rewrites

  • Improve the Members component adding permastructs and custom rewrite

rules for registration and activation pages.

  • Improve the Blogs component adding custom rewrite rule to handle the

Blogs create page.

  • Make a huge progress about replacing all occurrences of

bp_get_root_domain() (45 replacements were performed).

  • Deprecate bp_groups_directory_permalink(),

bp_get_groups_directory_permalink(), bp_blogs_directory_permalink() &
bp_get_blogs_directory_permalink() and replace them with these new
functions: bp_groups_directory_url(), bp_get_groups_directory_url(),
bp_blogs_directory_url() & bp_get_blogs_directory_url().

  • Although bp_loggedin_user_domain() & bp_displayed_user_domain()

should also be deprecated, we're leaving them as aliases of the right
functions to use. Plugin authors shouldn't use them to build other links
than member's profile home url.

NB: these deprecations are required because these functions were used
to build BuddyPress URLs concatenating URL chunks. Once the BP Classic
plugin will be built we will adapt the code to remove these deprecation
notices.

Props r-a-y, johnjamesjacoby, boonebgorges

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/activity/template-tags.php

    r13213 r13436  
    553553            }
    554554
     555            $spam_link = bp_rewrites_get_url(
     556                array(
     557                    'component_id'                 => 'activity',
     558                    'single_item_action'           => 'spam',
     559                    'single_item_action_variables' => array( bp_get_activity_id() ),
     560                )
     561            );
     562
    555563            $buttons['activity_spam']['button_attr'][ $data_element ] = wp_nonce_url(
    556                 bp_get_root_domain() . '/' . bp_nouveau_get_component_slug( 'activity' ) . '/spam/' . $activity_id . '/',
     564                bp_rewrites_get_url(
     565                    array(
     566                        'component_id'                 => 'activity',
     567                        'single_item_action'           => 'spam',
     568                        'single_item_action_variables' => array( $activity_id ),
     569                    )
     570                ),
    557571                'bp_activity_akismet_spam_' . $activity_id
    558572            );
     
    882896
    883897            $buttons['activity_comment_spam']['button_attr'][ $data_element ] = wp_nonce_url(
    884                 bp_get_root_domain() . '/' . bp_nouveau_get_component_slug( 'activity' ) . '/spam/' . $activity_comment_id . '/?cid=' . $activity_comment_id,
     898                add_query_arg(
     899                    'cid',
     900                    $activity_comment_id,
     901                    bp_rewrites_get_url(
     902                        array(
     903                            'component_id'                 => 'activity',
     904                            'single_item_action'           => 'spam',
     905                            'single_item_action_variables' => array( $activity_comment_id ),
     906                        )
     907                    )
     908                ),
    885909                'bp_activity_akismet_spam_' . $activity_comment_id
    886910            );
Note: See TracChangeset for help on using the changeset viewer.