| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Prime Slider widget filters |
| 5 |
* @since 3.0.0 |
| 6 |
*/ |
| 7 |
|
| 8 |
use UltimatePostKit\Admin\ModuleService; |
| 9 |
|
| 10 |
|
| 11 |
if (!defined('ABSPATH')) exit; // Exit if accessed directly |
| 12 |
|
| 13 |
// Settings Filters |
| 14 |
if (!function_exists('upk_is_dashboard_enabled')) { |
| 15 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- established function name relied on across the plugin family / feedback SDK; renaming would break integration. |
| 16 |
function upk_is_dashboard_enabled() { |
| 17 |
return apply_filters('ultimatepostkit/settings/dashboard', true); |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
if (!function_exists('ultimate_post_kit_is_widget_enabled')) { |
| 22 |
function ultimate_post_kit_is_widget_enabled($widget_id, $options = []) { |
| 23 |
|
| 24 |
if(!$options){ |
| 25 |
$options = get_option('ultimate_post_kit_active_modules', []); |
| 26 |
} |
| 27 |
|
| 28 |
if( ModuleService::is_module_active($widget_id, $options)){ |
| 29 |
$widget_id = str_replace('-','_', $widget_id); |
| 30 |
return apply_filters("ultimatepostkit/widget/{$widget_id}", true); |
| 31 |
} |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
if (!function_exists('ultimate_post_kit_is_extend_enabled')) { |
| 36 |
function ultimate_post_kit_is_extend_enabled($widget_id, $options = []) { |
| 37 |
|
| 38 |
if(!$options){ |
| 39 |
$options = get_option('ultimate_post_kit_elementor_extend', []); |
| 40 |
} |
| 41 |
|
| 42 |
if( ModuleService::is_module_active($widget_id, $options)){ |
| 43 |
$widget_id = str_replace('-','_', $widget_id); |
| 44 |
return apply_filters("ultimatepostkit/extend/{$widget_id}", true); |
| 45 |
} |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
// if (!function_exists('ultimate_post_kit_is_third_party_enabled')) { |
| 50 |
// function ultimate_post_kit_is_third_party_enabled($widget_id, $options = []) { |
| 51 |
|
| 52 |
// if(!$options){ |
| 53 |
// $options = get_option('ultimate_post_kit_third_party_widget', []); |
| 54 |
// } |
| 55 |
|
| 56 |
// if( ModuleService::is_module_active($widget_id, $options)){ |
| 57 |
// $widget_id = str_replace('-','_', $widget_id); |
| 58 |
// return apply_filters("ultimatepostkit/widget/{$widget_id}", true); |
| 59 |
// } |
| 60 |
// } |
| 61 |
// } |
| 62 |
|
| 63 |
// if (!function_exists('ultimate_post_kit_is_asset_optimization_enabled')) { |
| 64 |
// function ultimate_post_kit_is_asset_optimization_enabled() { |
| 65 |
// $asset_manager = ultimate_post_kit_option('asset-manager', 'ultimate_post_kit_other_settings', 'off'); |
| 66 |
// if( $asset_manager == 'on'){ |
| 67 |
// return apply_filters("ultimatepostkit/optimization/asset_manager", true); |
| 68 |
// } |
| 69 |
// } |
| 70 |
// } |
| 71 |
|
| 72 |
|
| 73 |
|