public function get_rules_result() {
		if ( ! papi_get_sanitized_post( 'data' ) ) {
			$this->render_error( 'No rule found' );

			return;
		}

		$data = json_decode( stripslashes( papi_get_sanitized_post( 'data' ) ), true );

		if ( empty( $data ) || ! is_array( $data ) || ! isset( $data['slug'] ) ) {
			$this->render_error( 'No rule found' );

			return;
		}

		$entry_type = papi_get_entry_type_by_meta_id();

		if ( empty( $entry_type ) ) {
			$entry_type_id = papi_get_qs( 'entry_type' );
			$entry_type    = papi_get_entry_type_by_id( $entry_type_id );
		}

		if ( $entry_type instanceof Papi_Entry_Type === false ) {
			$this->render_error( 'No rule found' );

			return;
		}

		if ( preg_match( '/\[\]$/', $data['slug'] ) ) {
			$data['slug'] = preg_replace( '/\[\]$/', '', $data['slug'] );
		}

		if ( $property = $entry_type->get_property( $data['slug'] ) ) {
			wp_send_json( [
				'render' => $property->render_is_allowed_by_rules( $data['rules'] )
			] );

			return;
		}

		$this->render_error( 'No rule found' );
	}
public function get_rules_result() {
		if ( ! papi_get_sanitized_post( 'data' ) ) {
			$this->render_error( 'No rule found' );

			return;
		}

		$data = json_decode( stripslashes( papi_get_sanitized_post( 'data' ) ), true );

		if ( empty( $data ) || ! is_array( $data ) || ! isset( $data['slug'] ) ) {
			$this->render_error( 'No rule found' );

			return;
		}

		$entry_type = papi_get_entry_type_by_meta_id();

		if ( empty( $entry_type ) ) {
			$entry_type_id = papi_get_qs( 'entry_type' );
			$entry_type    = papi_get_entry_type_by_id( $entry_type_id );
		}

		if ( $entry_type instanceof Papi_Entry_Type === false ) {
			$this->render_error( 'No rule found' );

			return;
		}

		if ( preg_match( '/\[\]$/', $data['slug'] ) ) {
			$data['slug'] = preg_replace( '/\[\]$/', '', $data['slug'] );
		}

		if ( $property = $entry_type->get_property( $data['slug'] ) ) {
			wp_send_json( [
				'render' => $property->render_is_allowed_by_rules( $data['rules'] )
			] );

			return;
		}

		$this->render_error( 'No rule found' );
	}
public function get_rules_result ( ) { if ( ! papi_get_sanitized_post ( 'data' ) ) { $ this -> render_error ( 'No rule found' ) ; return ; } $ data = json_decode ( stripslashes ( papi_get_sanitized_post ( 'data' ) ) , true ) ; if ( empty ( $ data ) || ! is_array ( $ data ) || ! isset ( $ data [ 'slug' ] ) ) { $ this -> render_error ( 'No rule found' ) ; return ; } $ entry_type = papi_get_entry_type_by_meta_id ( ) ; if ( empty ( $ entry_type ) ) { $ entry_type_id = papi_get_qs ( 'entry_type' ) ; $ entry_type = papi_get_entry_type_by_id ( $ entry_type_id ) ; } if ( $ entry_type instanceof Papi_Entry_Type === false ) { $ this -> render_error ( 'No rule found' ) ; return ; } if ( preg_match ( '/\[\]$/' , $ data [ 'slug' ] ) ) { $ data [ 'slug' ] = preg_replace ( '/\[\]$/' , '' , $ data [ 'slug' ] ) ; } if ( $ property = $ entry_type -> get_property ( $ data [ 'slug' ] ) ) { wp_send_json ( [ 'render' => $ property -> render_is_allowed_by_rules ( $ data [ 'rules' ] ) ] ) ; return ; } $ this -> render_error ( 'No rule found' ) ; }
Get rules result via GET.

GET /papi-ajax/?action=get_rules_result
Get rules result via GET .