Skip to content

Instantly share code, notes, and snippets.

@lewebsimple
lewebsimple / acf-dynamic-role.php
Created August 10, 2017 15:01
ACF role-based conditions on user new / edit forms
<?php
// Change default role dynamically on role selection change
add_action( 'acf/input/admin_head', 'acf_dynamic_default_role' );
function acf_dynamic_default_role() {
global $pagenow;
if ( $pagenow == 'user-new.php' ) {
?>
<script>