Created
November 6, 2025 13:32
-
-
Save plugin-republic/ee4dbdcc0687a103ba88f312447f681b to your computer and use it in GitHub Desktop.
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
| <?php | |
| /** | |
| * Change the product name for a child product | |
| */ | |
| function demo_change_child_product_title( $title, $child_product ) { | |
| if( ! is_object( $child_product ) || is_wp_error( $child_product ) ) { | |
| return $title; | |
| } | |
| if( $child_product->get_id() == 1234 ) { // Update your child product ID here | |
| $title = 'New name here'; // Change your new text here | |
| } | |
| return $title; | |
| } | |
| add_filter( 'pewc_child_product_title', 'demo_change_child_product_title', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment