Environment.php
33 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\MigrationLog\Helpers; |
| 4 | |
| 5 | /** |
| 6 | * Class Environment |
| 7 | * @package Give\MigrationLog\Helpers |
| 8 | * |
| 9 | * @since 2.10.0 |
| 10 | */ |
| 11 | class Environment { |
| 12 | /** |
| 13 | * Check if current page is database updates page. |
| 14 | * |
| 15 | * @return bool |
| 16 | */ |
| 17 | public static function isMigrationsPage() { |
| 18 | if ( ! isset( $_GET['page'], $_GET['tab'] ) ) { |
| 19 | return false; |
| 20 | } |
| 21 | |
| 22 | if ( |
| 23 | 'give-tools' === $_GET['page'] |
| 24 | && 'data' === $_GET['tab'] |
| 25 | && ( ! isset( $_GET['section'] ) || 'database_updates' === $_GET['section'] ) |
| 26 | ) { |
| 27 | return true; |
| 28 | } |
| 29 | |
| 30 | return false; |
| 31 | } |
| 32 | } |
| 33 |