Skip to content

Instantly share code, notes, and snippets.

Last active June 29, 2020 11:46
What would you like to do?
Fix for Advanced Custom Fields high priority
// Move elements around screen.
acf.addAction('prepare', function(){
// Use setTimeout to make sure field is loaded
// Move #acf_after_title-sortables after
// Post Title box and add classes and css for styling
// and presentation
.css('margin', '20px auto 40px')
, 1000);
// On save create copy of #acf_after_title-sortables and inset in #poststuff
$(document).on('click','.editor-post-publish-button', function(){
// Check if container in postbox is created
if($('#poststuff .postbox-container #acf_after_title-sortables-copy').length){
$('#poststuff .postbox-container #acf_after_title-sortables-copy').html(
// Update form with data
// Create clone of #acf_after_title-sortables and insert in #poststuff
.appendTo( $('#poststuff .postbox-container') );
}, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment