Skip to content

Instantly share code, notes, and snippets.

@lukecav
Last active February 20, 2026 20:48
Show Gist options
  • Select an option

  • Save lukecav/c6e39fb03f1839b303148846d321c749 to your computer and use it in GitHub Desktop.

Select an option

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
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.