diff --git a/src/bp-core/bp-core-options.php b/src/bp-core/bp-core-options.php
index de638993d..ec44b01e4 100644
|
a
|
b
|
function bp_is_activity_heartbeat_active( $default = true ) { |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | /** |
| 759 | | * Get the current theme package ID. |
| | 759 | * Get the current template pack ID. |
| 760 | 760 | * |
| 761 | 761 | * @since 1.7.0 |
| | 762 | * @since 3.0.0 Add support for WordPress themes to override template pack selection. |
| 762 | 763 | * |
| 763 | | * @param string $default Optional. Fallback value if not found in the database. |
| 764 | | * Default: 'legacy'. |
| 765 | | * @return string ID of the theme package. |
| | 764 | * @param string $default Optional. Fallback value if no preference set. Default: 'legacy'. |
| | 765 | * |
| | 766 | * @return string ID of the template pack. |
| 766 | 767 | */ |
| 767 | 768 | function bp_get_theme_package_id( $default = 'legacy' ) { |
| | 769 | $active_package = bp_get_option( '_bp_theme_package_id', $default ); |
| | 770 | $all_packages = array_keys( buddypress()->theme_compat->packages ); |
| | 771 | |
| | 772 | foreach ( $all_packages as $package ) { |
| | 773 | // e.g. "buddypress-use-nouveau", "buddypress-use-legacy". |
| | 774 | if ( current_theme_supports( "buddypress-use-{$package}" ) ) { |
| | 775 | $active_package = $package; |
| | 776 | break; |
| | 777 | } |
| | 778 | } |
| 768 | 779 | |
| 769 | 780 | /** |
| 770 | | * Filters the current theme package ID. |
| | 781 | * Filters the current template pack ID. |
| 771 | 782 | * |
| 772 | 783 | * @since 1.7.0 |
| 773 | 784 | * |
| 774 | | * @param string $value The current theme package ID. |
| | 785 | * @param string $value The template pack ID. |
| 775 | 786 | */ |
| 776 | | return apply_filters( 'bp_get_theme_package_id', bp_get_option( '_bp_theme_package_id', $default ) ); |
| | 787 | return apply_filters( 'bp_get_theme_package_id', $active_package ); |
| 777 | 788 | } |