Skip to content

Commit 9ad8166

Browse files
author
Md. Alimuzzaman Alim
committed
Hiding non library sync when not available.
#309
1 parent 5d0a213 commit 9ad8166

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

lib/classes/compatibility/ICompatibility.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ abstract class ICompatibility{
3333
protected $plugin_file = null;
3434
protected $theme_name = null;
3535
protected $first_party = false;
36+
protected $non_library_sync = false;
3637

3738
public function __construct(){
3839
$this->init();
@@ -147,6 +148,14 @@ public function init(){
147148
if(!is_network_admin() && !$this->is_plugin_active()){
148149
$this->enabled = 'inactive';
149150
}
151+
152+
/**
153+
* Checking whethere to show manual sync option.
154+
*/
155+
if($this->is_plugin_active() && $this->non_library_sync == true){
156+
global $show_non_library_sync;
157+
$show_non_library_sync = true;
158+
}
150159

151160
Module::register_module(array(
152161
'id' => $this->id,

lib/classes/compatibility/elementor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class Elementor extends ICompatibility {
1919
protected $constant = 'WP_STATELESS_COMPATIBILITY_ELEMENTOR';
2020
protected $description = 'Ensures compatibility with Elementor Page Builder. Sync css files generated by Elementor.';
2121
protected $plugin_file = 'elementor/elementor.php';
22+
protected $non_library_sync = true;
2223

2324
public function module_init($sm){
2425
add_filter( 'set_url_scheme', array($this, 'sync_rewrite_url'), 10, 3 );

lib/classes/compatibility/gravity-forms.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class GravityForm extends ICompatibility {
1818
protected $constant = 'WP_STATELESS_COMPATIBILITY_GF';
1919
protected $description = 'Enables support for these Gravity Forms features: file upload field, post image field, custom file upload field type.';
2020
protected $plugin_file = 'gravityforms/gravityforms.php';
21+
protected $non_library_sync = true;
2122

2223
public function module_init($sm){
2324
$this->plugin_version = \GFForms::$version;

lib/classes/compatibility/siteorigin-widget-bundle.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class SOWidgetCSS extends ICompatibility {
1717
protected $constant = 'WP_STATELESS_COMPATIBILITY_SOWB';
1818
protected $description = 'Enabled support for CSS files generated by SiteOrigin Widgets Bundle.';
1919
protected $plugin_file = 'so-widgets-bundle/so-widgets-bundle.php';
20+
protected $non_library_sync = true;
2021

2122
public function module_init($sm){
2223
add_filter( 'set_url_scheme', array( $this, 'set_url_scheme' ), 20, 3 );

static/views/regenerate_interface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@
2929
</label>
3030
</div>
3131

32+
<?php if(!empty($GLOBALS['show_non_library_sync'])):?>
3233
<div class="option">
3334
<label>
3435
<input ng-disabled="isRunning || isLoading" type="radio" name="action" value="sync_non_library_files" ng-model="action" />
3536
<?php _e( 'Synchronize non media library files between Google Storage and local server', ud_get_stateless_media()->domain ); ?>
3637
</label>
3738
</div>
39+
<?php endif;?>
3840

3941
</div>
4042

0 commit comments

Comments
 (0)