Updates aggregate form statistics for the evaluator.
Description
See also
Parameters
- $form_id
-
(int) (Required) Form ID.
- $data
-
(array) (Required) Array of statistics.
Return
(bool) True on success, false on failure.
Source
File: src/modules/evaluators/evaluator.php
public function update_stats( $form_id, $data ) { $stats = $this->module->manager()->meta()->get( 'post', $form_id, $this->module->manager()->get_prefix() . 'stats', true ); if ( ! is_array( $stats ) ) { $stats = array(); } $stats_slug = $this->get_meta_identifier(); $stats[ $stats_slug ] = $data; return (bool) $this->module->manager()->meta()->update( 'post', $form_id, $this->module->manager()->get_prefix() . 'stats', $stats ); }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |