class-orders.php in Orderable – Restaurant & Food Ordering System 0.2.0, at inc/class-orders.php
| 1 | <?php |
| 2 | /** |
| 3 | * Order methods. |
| 4 | * |
| 5 | * @package Orderable/Classes |
| 6 | */ |
| 7 | |
| 8 | defined( 'ABSPATH' ) || exit; |
| 9 | |
| 10 | /** |
| 11 | * Orders class. |
| 12 | */ |
| 13 | class Orderable_Orders { |
| 14 | /** |
| 15 | * Is orders page. |
| 16 | * |
| 17 | * @return bool |
| 18 | */ |
| 19 | public static function is_orders_page() { |
| 20 | if ( ! is_admin() || ! function_exists( 'get_current_screen' ) ) { |
| 21 | return false; |
| 22 | } |
| 23 | |
| 24 | $screen = get_current_screen(); |
| 25 | |
| 26 | if ( ! $screen || 'edit-shop_order' !== $screen->id ) { |
| 27 | return false; |
| 28 | } |
| 29 | |
| 30 | return true; |
| 31 | } |
| 32 | } |