Created
June 4, 2015 09:05
-
-
Save psaikali/403a34a3c66fb5b557cc to your computer and use it in GitHub Desktop.
On ajoute deux champs de type text à l'onglet "Avancé" de la metabox produit WooCommerce
This file contains 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
/************************************************************************************************* | |
* On ajoute 2 champs (post meta ou custom field) aux produits WC dans l'onglet "Avancé" | |
*************************************************************************************************/ | |
function msk_add_loves_hates_fields_to_product() { | |
woocommerce_wp_text_input( | |
array( | |
'id' => 'loves', | |
'data_type' => 'decimal', | |
'label' => __('Loves', 'msk'), | |
'placeholder' => __('Amount of love', 'msk'), | |
'description' => __('Love this product has received.', 'msk'), | |
'desc_tip' => true | |
) | |
); | |
woocommerce_wp_text_input( | |
array( | |
'id' => 'hates', | |
'data_type' => 'decimal', | |
'label' => __('Hates', 'msk'), | |
'placeholder' => __('Amount of hate', 'msk'), | |
'description' => __('Hatred this product has received.', 'msk'), | |
'desc_tip' => true | |
) | |
); | |
} | |
add_action('woocommerce_product_options_advanced', 'msk_add_loves_hates_fields_to_product'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment