Skip to content

Instantly share code, notes, and snippets.

@baerkins
Created January 12, 2018 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baerkins/275e7ec1e1b8e8b8f05a85a2ebcb6901 to your computer and use it in GitHub Desktop.
Save baerkins/275e7ec1e1b8e8b8f05a85a2ebcb6901 to your computer and use it in GitHub Desktop.
<?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>';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment