Skip to content

Instantly share code, notes, and snippets.

@ScottDeLuzio
Created October 19, 2017 19:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScottDeLuzio/af61b942c945f55533bbf93e295fb47e to your computer and use it in GitHub Desktop.
Save ScottDeLuzio/af61b942c945f55533bbf93e295fb47e to your computer and use it in GitHub Desktop.
Filters the output of radio buttons in Conditional Woo Checkout Field Pro
<?php
add_filter( 'cwcfp_radio_input_filter', 'custom_radio_button_field', 10, 4 );
function custom_radio_button_field( $option_key, $option_text, $key, $value ){
$options = '<label class="radio-input block">' . $option_text . '</label><input type="radio" name="' . $key . '" id="' . $key . '" value="' . $option_key . '" ' . selected( $value, $option_key, false ) . 'class="select">' . $option_text . "\r\n";
return $options;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment