Last active
February 22, 2018 09:05
-
-
Save anwas/fa41cb4addfb1dce091ca1952d60c713 to your computer and use it in GitHub Desktop.
[WC Variation Dropdown Text] #wordpress #woocommerce #plugins #php
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
<?php | |
/** | |
* Plugin Name: WC Variation Dropdown Text | |
* Plugin URI: http://gelazius.eu | |
* Description: WC Variation Dropdown Text plugin replaces the default WooCommerce variation text from "Choose an option" to the current attribute title. | |
* Version: 1.0 | |
* Author: Vytenis Gelažius | |
* Author URI: http://gelazius.eu | |
**/ | |
if (!defined('ABSPATH')) { | |
die('-1'); | |
} | |
function WC_Variation_Dropdown_Options($args) { | |
$args['show_option_none'] = __($args["attribute"], 'woocommerce'); | |
return $args; | |
} | |
add_filter('woocommerce_dropdown_variation_attribute_options_args', 'WC_Variation_Dropdown_Options', 10, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment