Repeatable_Field::logged_in()

Description #

Handle ajax for logged in users.

Source #

File: ajax/repeatable-field.php

	public function logged_in() {
		$field_name     = $this->req( 'field_name' );
		$current_groups = $this->req( 'current_groups' );

		$_REQUEST[ $field_name . '-g' ] = $current_groups;
		$_REQUEST[ $field_name . '-n' ] = ap_sanitize_unslash( 'current_nonce', 'r' );

		$form  = anspress()->get_form( 'question' );
		$field = $form->find( $field_name, false, 'field_name' );

		if ( ! empty( $field ) && is_object( $field ) ) {
			if ( $field->get_last_field() ) {
				$this->set_success();

				$this->add_res( 'html', $field->get_last_field()->output() );
				$this->add_res( 'nonce', wp_create_nonce( $field_name . ( $current_groups + 1 ) ) );
			}
		}

	}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment