gform_gfuser_object_init

Removed: This hook was removed in version 3.0 with no replacement.

Description

Fires on the feed configuration page after the DOM has been loaded and the GFUser javascript object has been initialized.

Usage

<script type="text/javascript">
    jQuery(document).on('gform_gfuser_object_init', function(){

        // code to fire once the GFUser object has been initialized goes here

    });
</script>

Parameters

No parameters are passed to this event; however, it is useful to note that the GFUser object is a global namespace and properties can be safely added to it from this event.

Examples

This event is useful when wishing to add or modify values in the GFUser object. In the below example you can see how to add two values to the GFUser object and then call another function that process these new properties.

<script type="text/javascript">
    jQuery(document).on('gform_gfuser_object_init', function(){

        // add buddypress properties to GFUser object
        GFUser.buddypress_meta = <?php echo (!empty($config['meta']['buddypress_meta'])) ? GFCommon::json_encode($config['meta']['buddypress_meta']) : "[new BuddyPressMetaOption()]"; ?>;
        GFUser.buddypress_options = <?php echo GFCommon::json_encode(self::get_buddypress_fields()); ?>;

        CreateBuddyPressMetaOptions();

    });
</script>

Source Code

This filter is located in userregistration.php.