Changeset 9844 for trunk/src/bp-core/bp-core-template.php
- Timestamp:
- 05/06/2015 11:01:27 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template.php
r9819 r9844 1846 1846 1847 1847 /** 1848 * Check whether a given component has been activated by the admin. 1848 * Check whether a given component (or feature of a component) is active. 1849 * 1850 * @since BuddyPress (1.2.0) See r2539. 1851 * @since BuddyPress (2.3.0) Added $feature as a parameter. 1849 1852 * 1850 1853 * @param string $component The component name. 1851 * @return bool True if the component is active, otherwise false. 1852 */ 1853 function bp_is_active( $component = '' ) { 1854 * @param string $feature The feature name. 1855 * @return bool 1856 */ 1857 function bp_is_active( $component = '', $feature = '' ) { 1854 1858 $retval = false; 1855 1859 … … 1862 1866 if ( isset( buddypress()->active_components[ $component ] ) || isset( buddypress()->required_components[ $component ] ) ) { 1863 1867 $retval = true; 1868 1869 // Is feature active? 1870 if ( ! empty( $feature ) ) { 1871 if ( empty( buddypress()->$component->features ) || false === in_array( $feature, buddypress()->$component->features, true ) ) { 1872 $retval = false; 1873 } 1874 1875 /** 1876 * Filters whether or not a given feature for a component is active. 1877 * 1878 * @since BuddyPress (2.3.0) 1879 * 1880 * @param bool $retval 1881 */ 1882 $retval = apply_filters( "bp_is_{$component}_{$feature}_active", $retval ); 1883 } 1864 1884 } 1865 1885
Note: See TracChangeset
for help on using the changeset viewer.