_class_name = $class_name; return $class_name; } /** * Returns the step label. * * @return string */ public function get_label() { return esc_html__( 'User Registration', 'gravityflow' ); } /** * Returns the HTML for the step icon. * * @return string */ public function get_icon_url() { return ''; } /** * Returns the feeds for the add-on. * * @return array */ public function get_feeds() { $form_id = $this->get_form_id(); if ( class_exists( 'GF_User_Registration' ) ) { $feeds = parent::get_feeds(); } else { $feeds = GFUserData::get_feeds( $form_id ); } return $feeds; } /** * Processes the given feed for the add-on. * * @param array $feed The add-on feed properties. * * @return bool Is feed processing complete? */ function process_feed( $feed ) { if ( class_exists( 'GF_User_Registration' ) ) { parent::process_feed( $feed ); $activation_enabled = isset( $feed['meta']['userActivationEnable'] ) && $feed['meta']['userActivationEnable']; $step_complete = ! $activation_enabled; return $step_complete; } // User Registration < 3.0. $form = $this->get_form(); $entry = $this->get_entry(); remove_filter( 'gform_disable_registration', '__return_true' ); GFUser::gf_create_user( $entry, $form ); // Make sure it's not run twice. add_filter( 'gform_disable_registration', '__return_true' ); return true; } /** * Prevent the feeds assigned to the current step from being processed by the associated add-on. */ public function intercept_submission() { if ( class_exists( 'GF_User_Registration' ) ) { parent::intercept_submission(); return; } add_filter( 'gform_disable_registration', '__return_true' ); } /** * Returns the feed name. * * @param array $feed The feed properties. * * @return string */ public function get_feed_label( $feed ) { if ( class_exists( 'GF_User_Registration' ) ) { return parent::get_feed_label( $feed ); } $label = $feed['meta']['feed_type'] == 'create' ? __( 'Create', 'gravityflow' ) : __( 'Update', 'gravityflow' ); return $label; } /** * Displays content inside the Workflow metabox on the workflow detail page. * * @param array $form The Form array which may contain validation details. * @param array $args Additional args which may affect the display. */ public function workflow_detail_box( $form, $args ) { $step_status = $this->get_status(); $status_label = $this->get_status_label( $step_status ); $display_step_status = (bool) $args['step_status']; ?>