Advertisement
palsushobhan

product-custom-fields-on-translated-product

Aug 10th, 2024
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. add_action( 'end_wcfm_products_manage', function() {
  2.     global $WCFM;
  3.     remove_action( 'end_wcfm_products_manage', array( $WCFM->wcfm_customfield_support, 'wcfm_custom_field_products_manage_views' ), 200 );
  4. }, 99 );
  5.  
  6. add_action( 'after_wcfm_products_manage_tabs_content', function() {
  7.     global $WCFM;
  8.     if (apply_filters('wcfm_is_pref_custom_field', true)) {
  9.         $WCFM->template->get_template( 'products-manager/wcfm-view-customfield-products-manage.php' );
  10.     }
  11. } );
  12.  
  13. add_action('after_wcfm_products_manage', function() {
  14.     ?>
  15.     <script>
  16.         jQuery(function($) {
  17.             var triggerChange = function triggerChange() {
  18.                 setTimeout(function() {
  19.                     $('.wcfm-tabWrap div.page_collapsible:visible:first').trigger('click');
  20.                 }, 1000);
  21.             };
  22.             $( document.body ).on( 'wcfm_product_type_changed', triggerChange);
  23.         });
  24.     </script>
  25.     <?php
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement