Jay Lee
Jay Lee

Reputation: 65

How to Edit or Customize the WooCommerce add order button on admin

I already googled this but I found nothing, so Im asking here can anyone help how to edit the "Add order" button to "Add Transactions"..

Button

Upvotes: 1

Views: 105

Answers (1)

FrancescoCarlucci
FrancescoCarlucci

Reputation: 1590

the code is untested but it should work ;)

Double check the spelling of "Add order", the capitalization has to be exactly the same to make it work.

function translate_add_order_backend( $translated_text, $text, $domain ) {

    if( is_admin() ) {

      switch ( $translated_text ) {
          case 'Add order' :
              $translated_text = 'Add Transactions';
              break;
      }

    }

    return $translated_text;

}

add_filter( 'gettext', 'translate_add_order_backend', 20, 3 );

The code can be pasted into your theme functions.php file.

Upvotes: 1

Related Questions