Skip to content

Commit 378fa1a

Browse files
committed
chore: mode the pro popup blocker to separate function
1 parent 565348d commit 378fa1a

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

classes/Visualizer/Render/Library.php

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,12 @@ private function getDisplayForm() {
206206
</form>
207207
</div>';
208208
}
209-
210209
/**
211-
* Renders library content.
212-
*
213-
* @since 1.0.0
210+
* Renders pro charts blocker.
214211
*
215212
* @access private
216213
*/
217-
private function _renderLibrary() {
214+
private function _renderProPopupBlocker () {
218215
$license = get_option( 'visualizer_pro_license_data', 'free' );
219216
$license_key = '';
220217
$download_id = '';
@@ -224,10 +221,7 @@ private function _renderLibrary() {
224221
}
225222
$admin_license_url = admin_url( 'options-general.php#visualizer_pro_license' );
226223
$renew_license_url = tsdk_utmify( Visualizer_Plugin::STORE_URL . '?edd_license_key=' . $license_key . '&download_id=' . $download_id, 'visualizer_license_block' );
227-
// Added by Ash/Upwork
228-
$filterBy = ! empty( $_GET['s'] ) ? sanitize_text_field( wp_unslash( $_GET['s'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
229-
// Added by Ash/Upwork
230-
echo $this->custom_css;
224+
231225
if ( ! Visualizer_Module::is_pro() ) {
232226
echo '
233227
<div class="vizualizer-renew-notice-overlay" id="overlay-visualizer"></div>
@@ -257,6 +251,23 @@ private function _renderLibrary() {
257251
});
258252
</script>';
259253
}
254+
}
255+
/**
256+
* Renders library content.
257+
*
258+
* @since 1.0.0
259+
*
260+
* @access private
261+
*/
262+
private function _renderLibrary() {
263+
264+
// Added by Ash/Upwork
265+
$filterBy = ! empty( $_GET['s'] ) ? sanitize_text_field( wp_unslash( $_GET['s'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
266+
// Added by Ash/Upwork
267+
echo $this->custom_css;
268+
269+
$this->_renderProPopupBlocker();
270+
260271
echo '<div id="visualizer-types" class="visualizer-clearfix">';
261272
echo '<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><symbol id="list-icon" fill="currentColor"><path d="M8 0C3.58 0 0 3.58 0 8C0 12.42 3.58 16 8 16C12.42 16 16 12.42 16 8C16 3.58 12.42 0 8 0ZM7.385 12.66H6.045L2.805 8.12L4.146 6.87L6.715 9.27L11.856 3.339L13.196 4.279L7.385 12.66Z"/></symbol></svg>';
262273
$this->getDisplayForm();

0 commit comments

Comments
 (0)