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