I have added an action button to the orders page and I want it to open in a new window. This is my code:

 if ( $order->has_status( array( 'processing' ) ) ) {

        // Get Order ID (compatibility all WC versions)
        $order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;
        // Set the action button
        $actions['parcial'] = array(
        'url'       => wp_nonce_url( str_replace("https://","",plugins_url( 'generate_label.php', __FILE__ ) . '?text=' . $order_id), 'woocommerce-mark-order-status' ),
        'name'      => __( 'Print Labels', 'woocommerce' ),
        'target'    => '_blank',
        'action'    => "view parcial", // keep "view" class for a clean button CSS

What do I need to add in order to accomplish it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.