| @@ 112-137 (lines=26) @@ | ||
| 109 | * WPMU is disabled or plugin is |
|
| 110 | * activated on an individual blog. |
|
| 111 | */ |
|
| 112 | public static function activate( $network_wide ) { |
|
| 113 | ||
| 114 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 115 | ||
| 116 | if ( $network_wide ) { |
|
| 117 | ||
| 118 | // Get all blog ids |
|
| 119 | $blog_ids = self::get_blog_ids(); |
|
| 120 | ||
| 121 | foreach ( $blog_ids as $blog_id ) { |
|
| 122 | ||
| 123 | switch_to_blog( $blog_id ); |
|
| 124 | self::single_activate(); |
|
| 125 | } |
|
| 126 | ||
| 127 | restore_current_blog(); |
|
| 128 | ||
| 129 | } else { |
|
| 130 | self::single_activate(); |
|
| 131 | } |
|
| 132 | ||
| 133 | } else { |
|
| 134 | self::single_activate(); |
|
| 135 | } |
|
| 136 | ||
| 137 | } |
|
| 138 | ||
| 139 | /** |
|
| 140 | * Fired when the plugin is deactivated. |
|
| @@ 149-175 (lines=27) @@ | ||
| 146 | * WPMU is disabled or plugin is |
|
| 147 | * deactivated on an individual blog. |
|
| 148 | */ |
|
| 149 | public static function deactivate( $network_wide ) { |
|
| 150 | ||
| 151 | if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 152 | ||
| 153 | if ( $network_wide ) { |
|
| 154 | ||
| 155 | // Get all blog ids |
|
| 156 | $blog_ids = self::get_blog_ids(); |
|
| 157 | ||
| 158 | foreach ( $blog_ids as $blog_id ) { |
|
| 159 | ||
| 160 | switch_to_blog( $blog_id ); |
|
| 161 | self::single_deactivate(); |
|
| 162 | ||
| 163 | } |
|
| 164 | ||
| 165 | restore_current_blog(); |
|
| 166 | ||
| 167 | } else { |
|
| 168 | self::single_deactivate(); |
|
| 169 | } |
|
| 170 | ||
| 171 | } else { |
|
| 172 | self::single_deactivate(); |
|
| 173 | } |
|
| 174 | ||
| 175 | } |
|
| 176 | ||
| 177 | /** |
|
| 178 | * Fired when a new site is activated with a WPMU environment. |
|