Skip to content

Instantly share code, notes, and snippets.

@ControlledChaos
Last active October 30, 2018 17:28
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 ControlledChaos/b7c5c968fd9c748c21fb9b203cf5feae to your computer and use it in GitHub Desktop.
Save ControlledChaos/b7c5c968fd9c748c21fb9b203cf5feae to your computer and use it in GitHub Desktop.
Set Advanced Custom Fields metabox priority.

Set Advanced Custom Fields Metabox Priority

WordPress & ACF Snippet

<?php
/**
* Set Advanced Custom Fields metabox priority.
*
* @param string $priority The metabox priority.
* @param array $field_group The field group data.
* @return string $priority The metabox priority, modified.
*/
function ccd_set_acf_metabox_priority( $priority, $field_group ) {
if ( 'My Field Group' === $field_group['title'] ) {
$priority = 'high';
}
return $priority;
}
add_filter( 'acf/input/meta_box_priority', 'ccd_set_acf_metabox_priority', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment