gform_user_registration_new_site_meta

Description

This filter allows the site meta to be modified while creating a new site.

Usage

add_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 array
    The form object.
  • $entry array
    The entry object.
  • $feed array
    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

add_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 ) {
  $site_meta['blog_template'] = 1;
  return $site_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.