Created
January 12, 2018 14:58
-
-
Save baerkins/275e7ec1e1b8e8b8f05a85a2ebcb6901 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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