Normally in WooCommerce Product Add-Ons Ultimate, the field description appears under the field elements. If you prefer to display the description directly under the field label, use this snippet:
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 | |
/** | |
* Move the description under the label for product add-ons | |
*/ | |
function prefix_field_description_list_layout( $item, $id, $group_layout, $file ) { | |
pewc_field_description( $item, $id, $group_layout ); | |
} | |
add_action( 'pewc_before_include_frontend_template', 'prefix_field_description_list_layout', 10, 4 ); | |
// Remove the description field from after the field | |
remove_action( 'pewc_after_field_template', 'pewc_field_description_list_layout' ); |
Here’s how to add the snippet.