From 3f037745c8f43351ac37538881dade100717966f Mon Sep 17 00:00:00 2001 From: contactashish13 Date: Sat, 24 Feb 2018 09:19:29 +0530 Subject: [PATCH 1/2] edit chart #226 --- classes/Visualizer/Module/Chart.php | 7 ++++++- classes/Visualizer/Render/Page/Data.php | 17 +++++++++-------- index.php | 3 +++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/classes/Visualizer/Module/Chart.php b/classes/Visualizer/Module/Chart.php index 590d7083..cf7eee09 100644 --- a/classes/Visualizer/Module/Chart.php +++ b/classes/Visualizer/Module/Chart.php @@ -262,9 +262,14 @@ public function renderChartPages() { // dispatch pages $this->_chart = get_post( $chart_id ); $tab = isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ? $_GET['tab'] : 'visualizer'; + + // skip chart type pages only for existing charts. + if ( VISUALIZER_SKIP_CHART_TYPE_PAGE && 'auto-draft' !== $this->_chart->post_status ) { + $tab = 'settings'; + } + switch ( $tab ) { case 'settings': - // changed by Ash/Upwork $this->_handleDataAndSettingsPage(); break; case 'type': // fall through. diff --git a/classes/Visualizer/Render/Page/Data.php b/classes/Visualizer/Render/Page/Data.php index 5948f222..59a6f435 100644 --- a/classes/Visualizer/Render/Page/Data.php +++ b/classes/Visualizer/Render/Page/Data.php @@ -401,15 +401,16 @@ class="dashicons dashicons-lock">', '', apply_filters( 'visualizer_pro_up * @access protected */ protected function _renderToolbar() { - // changed by Ash/Upwork - echo '
'; - echo ''; - esc_html_e( 'Back', 'visualizer' ); - echo ''; - echo '
'; + // don't show back button at all. + // NOTE: We can't be selective on the post_status here because when a new chart reaches the settings screen, its status changes to publish. + if ( ! VISUALIZER_SKIP_CHART_TYPE_PAGE ) { + echo '
'; + echo ''; + esc_html_e( 'Back', 'visualizer' ); + echo ''; + echo '
'; + } echo ''; - echo ''; - } } diff --git a/index.php b/index.php index f75b973e..325b50d9 100644 --- a/index.php +++ b/index.php @@ -30,6 +30,9 @@ defined( 'VISUALIZER_PRO' ) || define( 'VISUALIZER_PRO', false ); } // Added by Ash/Upwork + +define( 'VISUALIZER_SKIP_CHART_TYPE_PAGE', true ); + /** * Automatically loads classes for the plugin. Checks a namespace and loads only * approved classes. From 147032fb306eecc1d9b463ded6b14ac6bfcd17d0 Mon Sep 17 00:00:00 2001 From: contactashish13 Date: Sat, 24 Feb 2018 09:23:41 +0530 Subject: [PATCH 2/2] grunt --- index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/index.php b/index.php index 325b50d9..f4d13550 100644 --- a/index.php +++ b/index.php @@ -30,7 +30,6 @@ defined( 'VISUALIZER_PRO' ) || define( 'VISUALIZER_PRO', false ); } // Added by Ash/Upwork - define( 'VISUALIZER_SKIP_CHART_TYPE_PAGE', true ); /**