Changeset 13452 for trunk/src/bp-core/bp-core-rewrites.php
- Timestamp:
- 04/16/2023 02:57:37 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-rewrites.php
r13441 r13452 68 68 69 69 /** 70 * Returns the slug to use for the viewbelonging to the requested component.70 * Returns the slug to use for the screen belonging to the requested component. 71 71 * 72 72 * @since 12.0.0 73 73 * 74 74 * @param string $component_id The BuddyPress component's ID. 75 * @param string $rewrite_id The viewrewrite ID, used to find the custom slugs.75 * @param string $rewrite_id The screen rewrite ID, used to find the custom slugs. 76 76 * Eg: `member_profile_edit` will try to find the xProfile edit's slug. 77 * @param string $default_slug The viewdefault slug, used as a fallback.78 * @return string The slug to use for the viewbelonging to the requested component.77 * @param string $default_slug The screen default slug, used as a fallback. 78 * @return string The slug to use for the screen belonging to the requested component. 79 79 */ 80 80 function bp_rewrites_get_slug( $component_id = '', $rewrite_id = '', $default_slug = '' ) { 81 /** 82 * This filter is used by the BP Classic plugin to force `$default_slug` usage. 83 * 84 * Using the "Classic" BuddyPress means deprecated functions building URL concatening 85 * URL chunks are available, we cannot use the BP Rewrites API in this case & as a result 86 * slug customization is bypassed. 87 * 88 * The BP Classic plugin is simply returning the `$default_slug` to bypass slug customization. 89 * 90 * @since 12.0.0 91 * 92 * @param string $value An empty string to use as to know whether slug customization should be used. 93 * @param string $default_slug The screen default slug, used as a fallback. 94 * @param string $rewrite_id The screen rewrite ID, used to find the custom slugs. 95 * @param string $component_id The BuddyPress component's ID. 96 */ 97 $classic_slug = apply_filters( 'bp_rewrites_pre_get_slug', '', $default_slug, $rewrite_id, $component_id ); 98 if ( $classic_slug ) { 99 return $classic_slug; 100 } 101 81 102 $directory_pages = bp_core_get_directory_pages(); 82 103 $slug = $default_slug;
Note: See TracChangeset
for help on using the changeset viewer.