Last active
February 20, 2026 20:48
-
-
Save lukecav/c6e39fb03f1839b303148846d321c749 to your computer and use it in GitHub Desktop.
On the subscriptions list screen in wp-admin change the search order button to be search subscriptions in WooCommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'gettext', function( $translated, $text, $domain ) { | |
| // Only target WooCommerce strings in admin | |
| if ( ! is_admin() || $domain !== 'woocommerce' ) { | |
| return $translated; | |
| } | |
| // Check we're on the subscriptions list screen | |
| $screen = get_current_screen(); | |
| if ( $screen && $screen->id === 'woocommerce_page_wc-orders--shop_subscription' ) { | |
| if ( $text === 'Search orders' ) { | |
| return 'Search subscriptions'; | |
| } | |
| } | |
| return $translated; | |
| }, 20, 3 ); |
Comments are disabled for this gist.