Skip to content

Instantly share code, notes, and snippets.

@mitchellkrogza
Created June 14, 2021 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchellkrogza/decb43ac86d8f184114efa51733d5ec0 to your computer and use it in GitHub Desktop.
Save mitchellkrogza/decb43ac86d8f184114efa51733d5ec0 to your computer and use it in GitHub Desktop.
Change Woocommerce backorder message text
// Change backorder message text
function change_backorder_message( $text, $product ){
    if ( $product->managing_stock() && $product->is_on_backorder( 1 ) ) {
        $text = __( 'Place your text here', 'woocommerce' );
    }
    return $text;
}
add_filter( 'woocommerce_get_availability_text', 'change_backorder_message', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment