gform_author_dropdown_args

Description

This filter is executed when the form editor is loaded, when creating the author drop down selection for the Post Fields. Use this hook to change the list of authors displayed in the drop down by filtering the $args parameter to be passed to the wp_dropdown_users( $args ) function.

Usage

Applies to all forms:

add_filter( 'gform_author_dropdown_args', 'set_users' );

Applies to a specific form. In this case, form Id 5:

add_filter( 'gform_author_dropdown_args_5', 'set_users' );

Parameters

Examples

This example changes the author drop down so that it includes two users (Ids 1 and 8):

add_filter( 'gform_author_dropdown_args', 'set_users' );
function set_users( $args ) {
    $args['include'] = '1,8';
    return $args;
}

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in form_detail.php.