Repeatable::get_groups_count()

Description #

Get group count when requesting group from ajax.

Source #

File: lib/form/class-repeatable.php

	public function get_groups_count() {
		$current_groups = $this->get( sanitize_title( $this->field_name ) . '-g', null, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
		$nonce          = $this->get( sanitize_title( $this->field_name ) . '-n', null, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended

		if ( wp_verify_nonce( $nonce, $this->field_name . $current_groups ) ) {
			return $current_groups;
		}
	}

Leave a Reply

Your email address will not be published.

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

Add your comment