| @@ -89,8 +89,10 @@ | ||
| 89 | 89 | if ( strpos( strtolower( $this->_query ), ' limit ' ) === false ) { |
| 90 | 90 | $this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 1000, $this->_chart_id ); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | + $this->_query = apply_filters( 'visualizer_db_query', $this->_query, $this->_chart_id, $this->_params ); | |
| 94 | + | |
| 93 | 95 | $results = array(); |
| 94 | 96 | $headers = array(); |
| 95 | 97 | |
| 96 | 98 | // short circuit results for remote dbs. |
| @@ -144,11 +146,14 @@ | ||
| 144 | 146 | } |
| 145 | 147 | } |
| 146 | 148 | |
| 147 | 149 | if ( $as_html ) { |
| 148 | - return $this->html( $headers, $results ); | |
| 150 | + $results = $this->html( $headers, $results ); | |
| 151 | + } else { | |
| 152 | + $results = $this->object( $headers, $results ); | |
| 149 | 153 | } |
| 150 | - return $this->object( $headers, $results ); | |
| 154 | + | |
| 155 | + return apply_filters( 'visualizer_db_query_results', $results, $headers, $as_html, $results_as_numeric_array, $raw_results, $this->_query, $this->_chart_id, $this->_params ); | |
| 151 | 156 | } |
| 152 | 157 | |
| 153 | 158 | /** |
| 154 | 159 | * Get the data type of the column. |