PluginProbe
Polylang / 3.8.6
Polylang v3.8.6
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / src / install / abstract-deactivate.php

abstract-deactivate.php in Polylang 3.8.6, at src/install/abstract-deactivate.php

37 lines 949 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Polylang
4 *
5 * /!\ THE CONSTANTS `POLYLANG_BASENAME` AND `POLYLANG_VERSION` MUST BE DEFINED.
6 */
7
8 /**
9 * A generic deactivation class compatible with multisite.
10 *
11 * @since 3.8
12 */
13 abstract class PLL_Abstract_Deactivate extends PLL_Abstract_Activable {
14 /**
15 * Adds the required hooks.
16 *
17 * @since 3.8
18 *
19 * @return void
20 */
21 public static function add_hooks(): void {
22 register_deactivation_hook( static::get_plugin_basename(), array( static::class, 'do_for_all_blogs' ) );
23 }
24
25 /**
26 * Detects plugin deactivation.
27 *
28 * @since 1.7
29 * @since 3.8 Moved from the class `PLL_Install_Base`.
30 *
31 * @return bool True if the plugin is currently being deactivated.
32 */
33 public static function is_deactivation(): bool {
34 return isset( $_GET['action'], $_GET['plugin'] ) && 'deactivate' === $_GET['action'] && static::get_plugin_basename() === $_GET['plugin']; // phpcs:ignore WordPress.Security.NonceVerification
35 }
36 }
37