gform_author_dropdown_args

gform_author_dropdown_args

DescriptionUsageParametersExamplesPlacementSource Code

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:
1add_filter( 'gform_author_dropdown_args', 'set_users' );
Applies to a specific form. In this case, form Id 5:
1add_filter( 'gform_author_dropdown_args_5', 'set_users' );
Parameters

$args array
The args to be filtered, in the format expected by the wp_dropdown_users() WordPress function.

Examples
This example changes the author drop down so that it includes two users (Ids 1 and 8):
12345add_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.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注