BulkAction
1 month ago
views
1 month ago
AdminNotices.php
1 month ago
BulkAction.php
1 month ago
DispatchLabelFile.php
1 month ago
FilterOrders.php
1 month ago
ModifyOrderTable.php
1 month ago
ModifyStatuses.php
1 month ago
SubscriptionsIntegration.php
1 month ago
ModifyStatuses.php
39 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Class ModifyStatuses |
| 4 | */ |
| 5 | |
| 6 | namespace WPDesk\FS\Shipment; |
| 7 | |
| 8 | use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable; |
| 9 | |
| 10 | /** |
| 11 | * . |
| 12 | */ |
| 13 | class ModifyStatuses implements Hookable { |
| 14 | |
| 15 | /** |
| 16 | * @return void |
| 17 | */ |
| 18 | public function hooks() { |
| 19 | add_filter( 'flexible_shipping_status', [ $this, 'flexible_shipping_status' ] ); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @param mixed $statuses . |
| 24 | * |
| 25 | * @return array |
| 26 | */ |
| 27 | public function flexible_shipping_status( $statuses ): array { |
| 28 | $statuses = is_array( $statuses ) ? $statuses : []; |
| 29 | |
| 30 | $statuses['new'] = __( 'New', 'flexible-shipping' ); |
| 31 | $statuses['created'] = __( 'Created', 'flexible-shipping' ); |
| 32 | $statuses['confirmed'] = __( 'Confirmed', 'flexible-shipping' ); |
| 33 | $statuses['manifest'] = __( 'Manifest', 'flexible-shipping' ); |
| 34 | $statuses['failed'] = __( 'Failed', 'flexible-shipping' ); |
| 35 | |
| 36 | return $statuses; |
| 37 | } |
| 38 | } |
| 39 |