baerkins
1/12/2018 - 2:58 PM

ACF_Functions.php

<?php

// Add ACF Options Menu
if ( function_exists("acf_add_options_page") ) {
  acf_add_options_page();
}
if ( function_exists("register_options_page") ) {
  register_options_page( 'Global Options' );
  register_options_page( 'Page Options' );
}

// Group ACF Tabs
add_action('admin_footer', function() {
  echo '
  <!-- ACF Merge Tabs -->
  <script>
  var $boxes = jQuery("#postbox-container-2 .postbox .field_type-tab, #postbox-container-2 .postbox .acf-field-tab, #post-body-content .postbox .acf-field-tab").parent(".inside");
  if ($boxes.length > 1) {
    var $firstBox = $boxes.first();
    $boxes.not($firstBox).each(function() {
      jQuery(this).children().appendTo($firstBox);
      jQuery(this).parent(".postbox").remove();
    });
  }
  </script>';
});