Weird question but couldn’t find a way to overwrite any hook that is related to product description title. Is there a way to overwrite "Product description" and replace it with my own text? Thanks!
2
Try the code given below:
add_action( 'admin_enqueue_scripts', 'gs_admin_scripts', 20 ); function gs_admin_scripts(){ $screen = get_current_screen(); $screen_id = $screen ? $screen->id : ''; if ( in_array( $screen_id, array( 'product' ), true ) ) { wp_localize_script( 'wc-admin-product-editor', 'woocommerce_admin_product_editor', array( 'i18n_description' => esc_js( __( 'My Custom Description Title is here', 'woocommerce' ) ), ) ); } }
Add the code in the child theme`s functions.php or your plugin.
The code has been tested and working.
You can easily do like this example below (Tested and worked)
add_filter( 'gettext', 'your_prefix_change_product_description_title', 10, 2 ); function your_prefix_change_product_description_title( $alt, $text ) { global $pagenow, $typenow; if ('product' == $typenow ) { if ( 'Product description' == $text ) { return 'Your custom text'; } } return $alt; }
Click here to cancel reply.
2
Answers
Try the code given below:
Add the code in the child theme`s functions.php or your plugin.
The code has been tested and working.
You can easily do like this example below (Tested and worked)