bp_core_dynamically_add_number_in_path( $slug )
Dynamically add the number slug before folder path
Description
Parameters
- $slug
-
(Required)
Return
(mixed)
Source
File: bp-core/bp-core-help.php
function bp_core_dynamically_add_number_in_path( $slug ) {
$new_slug = bp_core_strip_number_from_slug( $slug );
$base_path = buddypress()->plugin_dir . 'bp-help';
$docs_path = $base_path . '/docs/';
$paths = bp_core_get_all_file_from_dir_and_subdir( $docs_path );
if ( ! empty( $paths ) ) {
foreach ( $paths as $path ) {
$file_path = str_replace( $docs_path, "", $path );
$path = bp_core_strip_number_from_slug( $file_path );
if ( $path == $new_slug ) {
$new_slug = $file_path;
break;
}
}
}
return $new_slug;
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.