From cd76ae82e767cc7d3fdfdd3e0fff4c23316b8bb1 Mon Sep 17 00:00:00 2001 From: Bryce Date: Tue, 2 Dec 2014 13:48:06 +0700 Subject: [PATCH] Add style field to woocommerce_wp_xxxxx_input Closes #6888 --- includes/admin/wc-meta-box-functions.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/admin/wc-meta-box-functions.php b/includes/admin/wc-meta-box-functions.php index 05e7ef5de25..9bb9d388ec7 100644 --- a/includes/admin/wc-meta-box-functions.php +++ b/includes/admin/wc-meta-box-functions.php @@ -5,7 +5,7 @@ * @author WooThemes * @category Core * @package WooCommerce/Admin/Functions -* @version 2.1.0 +* @version 2.3.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly @@ -22,6 +22,7 @@ function woocommerce_wp_text_input( $field ) { $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['placeholder'] = isset( $field['placeholder'] ) ? $field['placeholder'] : ''; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'short'; + $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; @@ -56,7 +57,7 @@ function woocommerce_wp_text_input( $field ) { } } - echo '

'; + echo '

'; if ( ! empty( $field['description'] ) ) { @@ -95,6 +96,7 @@ function woocommerce_wp_textarea_input( $field ) { $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['placeholder'] = isset( $field['placeholder'] ) ? $field['placeholder'] : ''; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'short'; + $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); @@ -108,7 +110,7 @@ function woocommerce_wp_textarea_input( $field ) { } } - echo '

'; + echo '

'; if ( ! empty( $field['description'] ) ) { @@ -131,6 +133,7 @@ function woocommerce_wp_checkbox( $field ) { $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'checkbox'; + $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); $field['cbvalue'] = isset( $field['cbvalue'] ) ? $field['cbvalue'] : 'yes'; @@ -146,7 +149,7 @@ function woocommerce_wp_checkbox( $field ) { } } - echo '

'; + echo '

'; if ( ! empty( $field['description'] ) ) { @@ -170,6 +173,7 @@ function woocommerce_wp_select( $field ) { $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'select short'; + $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); @@ -183,7 +187,7 @@ function woocommerce_wp_select( $field ) { } } - echo '

'; foreach ( $field['options'] as $key => $value ) { echo ''; @@ -212,6 +216,7 @@ function woocommerce_wp_radio( $field ) { $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'select short'; + $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; @@ -225,6 +230,7 @@ function woocommerce_wp_radio( $field ) { value="' . esc_attr( $key ) . '" type="radio" class="' . esc_attr( $field['class'] ) . '" + style="' . esc_attr( $field['style'] ) . '" ' . checked( esc_attr( $field['value'] ), esc_attr( $key ), false ) . ' /> ' . esc_html( $value ) . ' ';