Changeset 6301 for trunk/bp-core/bp-core-update.php
- Timestamp:
- 09/04/2012 02:24:31 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-update.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-update.php
r6093 r6301 38 38 * @since BuddyPress (1.6) 39 39 * 40 * @ global BuddyPress $bp40 * @uses buddypress() 41 41 * @return bool True if activating BuddyPress, false if not 42 42 */ 43 43 function bp_is_activation( $basename = '' ) { 44 global $bp;44 $bp = buddypress(); 45 45 46 // Baif if action or plugin are empty 47 if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) ) 46 $action = false; 47 if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) 48 $action = $_REQUEST['action']; 49 elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) 50 $action = $_REQUEST['action2']; 51 52 // Bail if not activating 53 if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) 48 54 return false; 49 55 50 // Bail if not activating 51 if ( 'activate' !== $_GET['action'] ) 52 return false; 53 54 // The plugin being activated 55 $plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : ''; 56 // The plugin(s) being activated 57 if ( $action == 'activate' ) 58 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); 59 else 60 $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 56 61 57 62 // Set basename if empty … … 63 68 return false; 64 69 65 // Bail if plugin is not BuddyPress 66 if ( $basename !== $plugin ) 67 return false; 68 69 return true; 70 // Is BuddyPress being activated? 71 return in_array( $basename, $plugins ); 70 72 } 71 73 … … 75 77 * @since BuddyPress (1.6) 76 78 * 77 * @ global BuddyPress $bp79 * @uses buddypress() 78 80 * @return bool True if deactivating BuddyPress, false if not 79 81 */ 80 82 function bp_is_deactivation( $basename = '' ) { 81 global $bp;83 $bp = buddypress(); 82 84 83 // Baif if action or plugin are empty 84 if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) ) 85 $action = false; 86 if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) 87 $action = $_REQUEST['action']; 88 elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) 89 $action = $_REQUEST['action2']; 90 91 // Bail if not deactivating 92 if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) 85 93 return false; 86 94 87 // Bail if not deactivating 88 if ( 'deactivate' !== $_GET['action'] ) 89 return false; 90 91 // The plugin being deactivated 92 $plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : ''; 95 // The plugin(s) being deactivated 96 if ( $action == 'deactivate' ) 97 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); 98 else 99 $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); 93 100 94 101 // Set basename if empty … … 100 107 return false; 101 108 102 // Bail if plugin is not BuddyPress 103 if ( $basename !== $plugin ) 104 return false; 105 106 return true; 109 // Is bbPress being deactivated? 110 return in_array( $basename, $plugins ); 107 111 } 108 112 … … 194 198 do_action( 'bp_uninstall' ); 195 199 } 196 197 ?>
Note: See TracChangeset
for help on using the changeset viewer.