groundhogg/owners

πŸ“… Published on

πŸ“ Last updated

Documentation

Β»

Filter Hooks

Β»

groundhogg/owners

Filters the array of WordPress users available as contact owners in dropdowns and assignment tools.

apply_filters( 'groundhogg/owners', $owners );

You will receive an array of WP_User objects.

Example

add_filter( 'groundhogg/owners', 'my_extension_filter_owners' );

/**
 * Limit the owner list to users who have completed onboarding.
 *
 * @param \WP_User[] $owners
 *
 * @return \WP_User[]
 */
function my_extension_filter_owners( $owners ) {
    return array_filter( $owners, function( $user ) {
        return get_user_meta( $user->ID, 'my_extension_onboarded', true );
    } );
}

Was this helpful?

Let us know if this document answered your question. That’s the only way we can improve.