Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Last active November 14, 2017 23:50
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 SiR-DanieL/53f642f0fa780019e3eb to your computer and use it in GitHub Desktop.
Save SiR-DanieL/53f642f0fa780019e3eb to your computer and use it in GitHub Desktop.
add_filter( 'woocommerce_product_tabs', 'woo_edit_tabs' );
function woo_edit_tabs( $tabs ) {
// Adds the new tab
$tabs['enquiry_form'] = array(
'title' => __( 'Ask a question', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_enquiry_form'
);
return $tabs;
}
function woo_enquiry_form() {
echo '<h2>' . __( 'Do you have a question?', 'woocommerce' ) . '</h2>';
echo '<p>' . __( 'Drop us a line by compiling the form below. We will be more than happy to reply to any of your questions!', 'woocommerce' ) . '</p>';
echo do_shortcode( '[your_form_shortcode_here]' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment