Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellenmace/e88a4f93fd84217f5c720fccab668507 to your computer and use it in GitHub Desktop.
Save kellenmace/e88a4f93fd84217f5c720fccab668507 to your computer and use it in GitHub Desktop.
Set Advanced Custom Fields metabox priority
<?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 km_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', 'km_set_acf_metabox_priority', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment