From 202458a1f353971a330258d6d5e3b6ec6fa93a81 Mon Sep 17 00:00:00 2001 From: akashsonic Date: Mon, 2 Jan 2017 18:01:52 +0530 Subject: [PATCH] Dynamic add 2 attribute. Add dynamic 2 attributes rows & cols in woocommerce_wp_textarea_input function. User can add dynamic this attributes in text-area field. --- includes/admin/wc-meta-box-functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/admin/wc-meta-box-functions.php b/includes/admin/wc-meta-box-functions.php index cdcb07cac58..a429735979d 100644 --- a/includes/admin/wc-meta-box-functions.php +++ b/includes/admin/wc-meta-box-functions.php @@ -109,6 +109,8 @@ function woocommerce_wp_textarea_input( $field ) { $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); $field['desc_tip'] = isset( $field['desc_tip'] ) ? $field['desc_tip'] : false; $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; + $field['rows'] = isset( $field['rows'] ) ? $field['rows'] : 2; + $field['cols'] = isset( $field['cols'] ) ? $field['cols'] : 20; // Custom attribute handling $custom_attributes = array(); @@ -127,7 +129,7 @@ function woocommerce_wp_textarea_input( $field ) { echo wc_help_tip( $field['description'] ); } - echo ' '; + echo ' '; if ( ! empty( $field['description'] ) && false === $field['desc_tip'] ) { echo '' . wp_kses_post( $field['description'] ) . '';