From d8a8970bd4e9ea4a844d2c43ec342e241a14218b Mon Sep 17 00:00:00 2001 From: Chuck Mac Date: Mon, 29 Sep 2014 12:15:26 -0400 Subject: [PATCH] Enable tooltip for woocommerce_wp_checkbox in metabox Allow the use of the `desc_tip` value to add a tooltip to the checkbox field as allowed by other metabox fields. --- includes/admin/wc-meta-box-functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/admin/wc-meta-box-functions.php b/includes/admin/wc-meta-box-functions.php index ecf5dc47c06..b009fb78512 100644 --- a/includes/admin/wc-meta-box-functions.php +++ b/includes/admin/wc-meta-box-functions.php @@ -129,7 +129,15 @@ function woocommerce_wp_checkbox( $field ) { echo '

'; - if ( ! empty( $field['description'] ) ) echo '' . wp_kses_post( $field['description'] ) . ''; + if ( ! empty( $field['description'] ) ) { + + if ( isset( $field['desc_tip'] ) && false !== $field['desc_tip'] ) { + echo ''; + } else { + echo '' . wp_kses_post( $field['description'] ) . ''; + } + + } echo '

'; }