gform_user_registration_new_site_meta

gform_user_registration_new_site_meta

DescriptionUsageParametersExamplePlacementSource Code

Description
This filter allows the site meta to be modified while creating a new site.
Usage
1add_filter( 'gform_user_registration_new_site_meta', 'your_function_name', 10, 6 );

Parameters

$site_meta array
An array of new site arguments (ex. if the site is public => 1).

$form Form Object
The Form Object.

$entry Entry Object
The Entry Object.

$feed Feed Object
The Feed Object.

$user_id int
The ID of the user who creates the site.

$is_update_feed boolean
True/false indicator of whether this is a feed to update an existing setup.

Example
12345add_filter( 'gform_user_registration_new_site_meta', 'add_blog_template', 10, 6 );function add_blog_template( $site_meta, $form, $entry, $feed, $user_id, $is_update_feed ) {  $signup_meta['blog_template'] = 1;  return $signup_meta;}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GF_User_Registration::create_site() in gravityformsuserregistration/class-gf-user-registration.php.

發表回覆

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