| 1 |
<?php |
| 2 |
/** |
| 3 |
* Order methods. |
| 4 |
* |
| 5 |
* @package Orderable/Classes |
| 6 |
*/ |
| 7 |
|
| 8 |
defined( 'ABSPATH' ) || exit; |
| 9 |
|
| 10 |
use Automattic\WooCommerce\Utilities\OrderUtil; |
| 11 |
|
| 12 |
/** |
| 13 |
* Orders class. |
| 14 |
*/ |
| 15 |
class Orderable_Orders { |
| 16 |
/** |
| 17 |
* Is orders page. |
| 18 |
* |
| 19 |
* @return bool |
| 20 |
*/ |
| 21 |
public static function is_orders_page() { |
| 22 |
if ( ! is_admin() || ! function_exists( 'get_current_screen' ) ) { |
| 23 |
return false; |
| 24 |
} |
| 25 |
|
| 26 |
require_once WC_ABSPATH . 'includes/admin/wc-admin-functions.php'; |
| 27 |
|
| 28 |
$current_screen = get_current_screen(); |
| 29 |
$shop_order_page_screen_id = OrderUtil::custom_orders_table_usage_is_enabled() ? wc_get_page_screen_id( 'shop-order' ) : 'edit-shop_order'; |
| 30 |
|
| 31 |
if ( ! $current_screen || $shop_order_page_screen_id !== $current_screen->id ) { |
| 32 |
return false; |
| 33 |
} |
| 34 |
|
| 35 |
return true; |
| 36 |
} |
| 37 |
} |
| 38 |
|