/** * Display the order status actions meta box * * @since 1.0.0 */ public function order_status_actions_meta_box() { global $post; $status = new WC_Order_Status_Manager_Order_Status($post->ID); ?> <ul class="order_status_actions submitbox"> <?php /** * Fires at the start of the order status actions meta box * * @since 1.0.0 * @param int $post_id The post id of the wc_order_status post */ do_action('wc_order_status_manager_order_status_actions_start', $post->ID); ?> <li class="wide"> <div id="delete-action"> <?php if (!$status->is_core_status() && current_user_can("delete_post", $post->ID)) { ?> <a class="submitdelete deletion" href="<?php echo esc_url(get_delete_post_link($post->ID, '', true)); ?> "><?php _e('Delete', WC_Order_Status_Manager::TEXT_DOMAIN); ?> </a><?php } ?> </div> <input type="submit" class="button save_order_status save_action button-primary tips" name="publish" value="<?php _e('Save Order Status', WC_Order_Status_Manager::TEXT_DOMAIN); ?> " data-tip="<?php _e('Save/update the order status', WC_Order_Status_Manager::TEXT_DOMAIN); ?> " /> </li> <?php /** * Fires at the end of the order status actions meta box * * @since 1.0.0 * @param int $post_id The post id of the wc_order_status post */ do_action('wc_order_status_manager_order_status_actions_end', $post->ID); ?> </ul> <?php }
/** * Order status & email row actions * * @since 1.0.0 * @param array $actions * @param WP_Post $post * @return array */ public function normalize_row_actions($actions, WP_Post $post) { if ($this->is_order_status_manager_post_type(get_post_type($post->ID))) { unset($actions['inline hide-if-no-js']); unset($actions['trash']); $order_status = new WC_Order_Status_Manager_Order_Status($post->ID); if (current_user_can('delete_post', $post->ID) && !$order_status->is_core_status()) { $actions['delete'] = sprintf('<a class="submitdelete" title="%s" href="%s">%s</a>', esc_attr__('Delete this item permanently', WC_Order_Status_Manager::TEXT_DOMAIN), get_delete_post_link($post->ID, '', true), __('Delete Permanently', WC_Order_Status_Manager::TEXT_DOMAIN)); } } return $actions; }