@@ -53,7 +53,7 @@ public function __construct( Visualizer_Plugin $plugin ) {
5353 parent ::__construct ( $ plugin );
5454 $ this ->_addFilter ( Visualizer_Plugin::FILTER_GET_CHART_SERIES , 'filterChartSeries ' , 1 , 2 );
5555 $ this ->_addFilter ( Visualizer_Plugin::FILTER_GET_CHART_DATA , 'filterChartData ' , 1 , 2 );
56- $ this ->_addFilter ( 'visualizer_pro_upsell ' , 'addProUpsell ' , 10 , 2 );
56+ $ this ->_addFilter ( 'visualizer_pro_upsell ' , 'addProUpsell ' , 10 , 3 );
5757 }
5858
5959 /**
@@ -129,7 +129,7 @@ public function filterChartData( $data, $chart_id ) {
129129 *
130130 * @return string The new html code.
131131 */
132- public function addProUpsell ( $ old , $ feature = null ) {
132+ public function addProUpsell ( $ old , $ feature = null , string $ docs_url = '' ) {
133133 $ pro_features = Visualizer_Module::get_features_for_license ( 1 );
134134 $ biz_features = Visualizer_Module::get_features_for_license ( 2 );
135135 $ return = '' ;
@@ -153,7 +153,10 @@ public function addProUpsell( $old, $feature = null ) {
153153 $ return .= ' <div class="only-pro-container"> ' ;
154154 $ return .= ' <div class="only-pro-inner"> ' ;
155155 $ return .= ' <p> ' . $ msg . '</p> ' ;
156- $ return .= ' <a target="_blank" href=" ' . tsdk_utmify ( Visualizer_Plugin::PRO_TEASER_URL , esc_attr ( $ feature ) ) . '" title=" ' . __ ( 'Upgrade Now ' , 'visualizer ' ) . '"> ' . __ ( 'Upgrade Now ' , 'visualizer ' ) . '</a> ' ;
156+ if ( ! empty ( $ docs_url ) ) {
157+ $ return .= ' <a target="_blank" href=" ' . esc_url ( $ docs_url ) . '" class="button button-secondary"> ' . esc_html__ ( 'Documentation ' , 'visualizer ' ) . '</a> ' ;
158+ }
159+ $ return .= ' <a target="_blank" href=" ' . tsdk_utmify ( Visualizer_Plugin::PRO_TEASER_URL , esc_attr ( $ feature ) ) . '" title=" ' . __ ( 'Upgrade Now ' , 'visualizer ' ) . '" class="button button-primary"> ' . __ ( 'Upgrade Now ' , 'visualizer ' ) . '</a> ' ;
157160 $ return .= ' </div> ' ;
158161 $ return .= ' </div> ' ;
159162 $ return .= '</div> ' ;
0 commit comments