At what point in the load sequence are User Groups registered?
-
This thread is for self-documenting an issue i’m encountering.
I am using WP User Groups with a couple of groups.
I am also using Advanced Custom Fields, and I am generating form fields with a custom function, as explained in the ACF documentation.
In that form, I try to make use of WP User Groups data, with query such as this (‘user-group’ being one of the default WP User Groups taxonomies):
$all_user_groups = get_terms( array( 'taxonomy' => 'user-group', 'hide_empty' => true, ) );
In other contexts this is working, but inside my ACF-form-building function, it returns nothing at all. The function is linked to the action ‘acf/init’, as recommended in the ACF docs. My assumption is that this action occurs too early in the load sequence, and the WP User Groups aren’t defined yet at that point.
The question then is: what is the appropriate action to use?
- The topic ‘At what point in the load sequence are User Groups registered?’ is closed to new replies.