Guest User

Untitled

a guest
Dec 7th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Add a custom tab to WooCommerce products
  5. *
  6. * @param (array) $tabs - Registered tabs
  7. * @return (array) $tabs - Updated array of tabs
  8. *
  9. * @author UltimateWoo <www.ultimatewoo.com>
  10. */
  11. function uw_custom_product_tab( $tabs ) {
  12.  
  13. global $post;
  14.  
  15. $tabs['uw_custom_product_tab'] = array(
  16. 'title' => 'Test Tab',
  17. 'priority' => 50,
  18. 'callback' => function( $key, $tab ) {
  19. echo "Our custom test tab's content, added via PHP!";
  20. }
  21. );
  22.  
  23. return $tabs;
  24. }
  25. add_action( 'woocommerce_product_tabs', 'uw_custom_product_tab' );
Add Comment
Please, Sign In to add comment