PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.7
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.7
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | classes/Visualizer/Source.php +12 -4 3.4.63.4.7 View file →
@@ -140,9 +140,12 @@
140 140 *
141 141 * @access public
142 142 * @return string The serialized array of data.
143 143 */
144 - public function getData() {
144 + public function getData( $fetch_from_editable_table = false ) {
145 + if ( $fetch_from_editable_table ) {
146 + $this->_fetchDataFromEditableTable();
147 + }
145 148 return serialize( $this->_data );
146 149 }
147 150
148 151 /**
@@ -152,9 +155,12 @@
152 155 *
153 156 * @access public
154 157 * @return array
155 158 */
156 - public function getRawData() {
159 + public function getRawData( $fetch_from_editable_table = false ) {
160 + if ( $fetch_from_editable_table ) {
161 + $this->_fetchDataFromEditableTable();
162 + }
157 163 return $this->_data;
158 164 }
159 165
160 166 /**
@@ -442,9 +448,8 @@
442 448 *
443 449 * @access private
444 450 */
445 451 private function _fetchDataFromEditableTable() {
446 - $params = $this->_args;
447 452 $headers = wp_list_pluck( $this->_series, 'label' );
448 453 $this->fetch();
449 454
450 455 $data = $this->_data;
@@ -451,9 +456,12 @@
451 456 $this->_data = array();
452 457
453 458 foreach ( $data as $line ) {
454 459 $data_row = array();
455 - foreach ( $line as $header => $value ) {
460 + // we have to make sure we are fetching the data in the right order
461 + // in case the columns have been reordered
462 + foreach ( $headers as $header ) {
463 + $value = $line[ $header ];
456 464 // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
457 465 if ( in_array( $header, $headers ) ) {
458 466 $data_row[] = $value;
459 467 }