Skip to content

Commit a5780f6

Browse files
enable feature by default
1 parent 334e672 commit a5780f6

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

classes/Visualizer/Module/Chart.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ public function __construct( Visualizer_Plugin $plugin ) {
5959
$this->_addAjaxAction( Visualizer_Plugin::ACTION_CLONE_CHART, 'cloneChart' );
6060
$this->_addAjaxAction( Visualizer_Plugin::ACTION_EXPORT_DATA, 'exportData' );
6161

62-
if ( strpos( VISUALIZER_ENABLE_BETA_FEATURES, 'db-query' ) !== false ) {
63-
$this->_addAjaxAction( Visualizer_Plugin::ACTION_FETCH_DB_DATA, 'getQueryData' );
64-
$this->_addAjaxAction( Visualizer_Plugin::ACTION_SAVE_DB_QUERY, 'saveQuery' );
65-
}
62+
$this->_addAjaxAction( Visualizer_Plugin::ACTION_FETCH_DB_DATA, 'getQueryData' );
63+
$this->_addAjaxAction( Visualizer_Plugin::ACTION_SAVE_DB_QUERY, 'saveQuery' );
6664
}
6765

6866
/**

classes/Visualizer/Render/Page/Data.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ class="dashicons dashicons-lock"></span></h2>
227227
</li>
228228

229229
<?php
230-
if ( strpos( VISUALIZER_ENABLE_BETA_FEATURES, 'db-query' ) !== false ) {
231230
$save_query = add_query_arg(
232231
array(
233232
'action' => Visualizer_Plugin::ACTION_SAVE_DB_QUERY,
@@ -278,7 +277,6 @@ class="dashicons dashicons-lock"></span></h2>
278277
</div>
279278
</div>
280279
</li>
281-
<?php } ?>
282280

283281
<?php
284282
// we will auto-open the manual data feature but only when pro is active and source is empty.
@@ -498,14 +496,12 @@ protected function _renderToolbar() {
498496
* @access private
499497
*/
500498
private function add_additional_content() {
501-
if ( strpos( VISUALIZER_ENABLE_BETA_FEATURES, 'db-query' ) !== false ) {
502-
$source = strtolower( get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_SOURCE, true ) );
503-
$query = '';
504-
if ( 'visualizer_source_query' === $source ) {
505-
$query = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_QUERY, true );
506-
}
507-
Visualizer_Render_Layout::show( 'db-query', $query );
499+
$source = strtolower( get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_SOURCE, true ) );
500+
$query = '';
501+
if ( 'visualizer_source_query' === $source ) {
502+
$query = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_QUERY, true );
508503
}
504+
Visualizer_Render_Layout::show( 'db-query', $query );
509505
}
510506

511507
}

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function visualizer_launch() {
7979
define( 'VISUALIZER_SKIP_CHART_TYPE_PAGE', true );
8080

8181
// if x and y features are required, this value should read x,y or x|y or x;y.
82-
define( 'VISUALIZER_ENABLE_BETA_FEATURES', 'db-query' );
82+
define( 'VISUALIZER_ENABLE_BETA_FEATURES', '' );
8383

8484
// the link to pre-build queries.
8585
define( 'VISUALIZER_DB_QUERY_DOC_URL', 'https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts' );

0 commit comments

Comments
 (0)