gform_webapi_get_users_settings_page

gform_webapi_get_users_settings_page

DescriptionUsageParametersExamplesPlacementSource Code

Description
Use this filter to control the list of users available to be selected in the 「Impersonate account」 setting. Note that this doesn』t control access to the API, it just controls the list of users available on the settings page.
Usage
add_filter( 'gform_webapi_get_users_settings_page', 'api_get_users_args' );

Parameters

$args array

array( 'number' => 3000 )
The array of options to use when filtering the users. See the WP_User_Query::prepare_query() reference on the WordPress codex for further details.

Examples
This example lists only the users from the role 「administrator」.
add_filter( 'gform_webapi_get_users_settings_page', 'api_get_users_args' );
function api_get_users_args( $args ) {
$args['role'] = 'administrator';
return $args;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFWebAPI::plugin_settings_fields() in includes/webapi.php

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註