- Timestamp:
- 09/02/2021 04:26:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/classes/class-bp-group-extension.php
r11773 r13101 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 if ( ! class_exists( 'BP_Group_Extension', false ) ) : 13 14 /** 14 15 * API for creating group extensions without having to hardcode the content into … … 1696 1697 } 1697 1698 } 1698 1699 /** 1700 * Register a new Group Extension. 1701 * 1702 * @since 1.1.0 1703 * 1704 * @param string $group_extension_class Name of the Extension class. 1705 * @return false|null Returns false on failure, otherwise null. 1706 */ 1707 function bp_register_group_extension( $group_extension_class = '' ) { 1708 1709 if ( ! class_exists( $group_extension_class ) ) { 1710 return false; 1711 } 1712 1713 // Register the group extension on the bp_init action so we have access 1714 // to all plugins. 1715 add_action( 'bp_init', function() use ( $group_extension_class ) { 1716 $extension = new $group_extension_class; 1717 add_action( 'bp_actions', array( &$extension, '_register' ), 8 ); 1718 add_action( 'admin_init', array( &$extension, '_register' ) ); 1719 }, 11 ); 1720 } 1699 endif; // End class_exists check.
Note: See TracChangeset
for help on using the changeset viewer.