| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if ( !defined( 'ABSPATH' ) ) exit; |
| 4 |
/* |
| 5 |
Plugin Name: Keon Toolset |
| 6 |
Plugin URI: |
| 7 |
Description: A demo importer plugin that makes importing starter sites effortless for building your website! |
| 8 |
Version: 2.5.7 |
| 9 |
Author: Keon Themes |
| 10 |
Author URI: https://keonthemes.com |
| 11 |
License: GPLv3 or later |
| 12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html |
| 13 |
Domain Path: /languages |
| 14 |
Text Domain: keon-toolset |
| 15 |
*/ |
| 16 |
define( 'KEON_TOOLSET_URL', plugin_dir_url( __FILE__ ).'demo/' ); |
| 17 |
define( 'KEON_TEMPLATE_URL', plugin_dir_url( __FILE__ ) ); |
| 18 |
define( 'KEON_TOOLSET_PATH', plugin_dir_path( __FILE__ ) ); |
| 19 |
define( 'KEON_TOOLSET_VERSION', '2.5.7'); |
| 20 |
// define( 'KEON_TOOLSET_KIRKI_VERSION', '5.1.1' ); |
| 21 |
// define( 'KEON_TOOLSET_KIRKI_PACKAGE_URL', 'https://downloads.wordpress.org/plugin/kirki.5.1.1.zip' ); |
| 22 |
// define( 'KEON_TOOLSET_KIRKI_PLUGIN_FILE', 'kirki/kirki.php' ); |
| 23 |
|
| 24 |
/** |
| 25 |
* Returns the currently active theme's name. |
| 26 |
* |
| 27 |
* @since 1.0.1 |
| 28 |
*/ |
| 29 |
function keon_toolset_get_theme_slug(){ |
| 30 |
$demo_theme = wp_get_theme(); |
| 31 |
return $demo_theme->get( 'TextDomain' ); |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Returns the currently active theme's screenshot. |
| 36 |
* |
| 37 |
* @since 1.0.0 |
| 38 |
*/ |
| 39 |
function keon_toolset_get_theme_screenshot(){ |
| 40 |
$demo_theme = wp_get_theme(); |
| 41 |
return $demo_theme->get_screenshot(); |
| 42 |
} |
| 43 |
/** |
| 44 |
* The core plugin class that is used to define internationalization,admin-specific hooks, |
| 45 |
* and public-facing site hooks.. |
| 46 |
* |
| 47 |
* @since 1.0.0 |
| 48 |
*/ |
| 49 |
require KEON_TOOLSET_PATH . 'demo/functions.php'; |
| 50 |
require KEON_TOOLSET_PATH . 'includes/class-template-library-base.php'; |
| 51 |
require KEON_TOOLSET_PATH . 'includes/theme-check-functions.php'; |
| 52 |
require KEON_TOOLSET_PATH . 'includes/admin-notices.php'; |
| 53 |
require_once KEON_TOOLSET_PATH . 'includes/class-elementor-image-import-fixer.php'; |
| 54 |
if ( class_exists( 'Keon_Toolset_Elementor_Image_Import_Fixer' ) ) { |
| 55 |
Keon_Toolset_Elementor_Image_Import_Fixer::init(); |
| 56 |
} |
| 57 |
|
| 58 |
/** |
| 59 |
* Prints Kirki version compatibility notice markup. |
| 60 |
* |
| 61 |
* @since 2.4.8 |
| 62 |
*/ |
| 63 |
function keon_toolset_kirki_notice_is_dismissed() { |
| 64 |
return (bool) get_option( 'keon_toolset_kirki_notice_dismissed', false ); |
| 65 |
} |
| 66 |
|
| 67 |
/** |
| 68 |
* Builds dismiss URL for the Kirki notice. |
| 69 |
* |
| 70 |
* @since 2.4.8 |
| 71 |
*/ |
| 72 |
function keon_toolset_kirki_notice_dismiss_url() { |
| 73 |
return wp_nonce_url( |
| 74 |
admin_url( 'admin-post.php?action=keon_toolset_dismiss_kirki_notice' ), |
| 75 |
'keon_toolset_dismiss_kirki_notice' |
| 76 |
); |
| 77 |
} |
| 78 |
|
| 79 |
/** |
| 80 |
* URL to install or replace Kirki with the bundled compatible version (via admin-post). |
| 81 |
* |
| 82 |
* @since 2.4.8 |
| 83 |
*/ |
| 84 |
function keon_toolset_kirki_install_action_url() { |
| 85 |
return wp_nonce_url( |
| 86 |
admin_url( 'admin-post.php?action=keon_toolset_install_kirki' ), |
| 87 |
'keon_toolset_install_kirki' |
| 88 |
); |
| 89 |
} |
| 90 |
|
| 91 |
/** |
| 92 |
* Handles dismiss request for the Kirki compatibility notice. |
| 93 |
* |
| 94 |
* @since 2.4.8 |
| 95 |
*/ |
| 96 |
function keon_toolset_handle_kirki_notice_dismiss() { |
| 97 |
if ( ! current_user_can( 'manage_options' ) ) { |
| 98 |
wp_die( esc_html__( 'You are not allowed to perform this action.', 'keon-toolset' ) ); |
| 99 |
} |
| 100 |
|
| 101 |
check_admin_referer( 'keon_toolset_dismiss_kirki_notice' ); |
| 102 |
update_option( 'keon_toolset_kirki_notice_dismissed', 1 ); |
| 103 |
|
| 104 |
$redirect_url = wp_get_referer(); |
| 105 |
if ( empty( $redirect_url ) ) { |
| 106 |
$redirect_url = admin_url(); |
| 107 |
} |
| 108 |
|
| 109 |
wp_safe_redirect( $redirect_url ); |
| 110 |
exit; |
| 111 |
} |
| 112 |
// add_action( 'admin_post_keon_toolset_dismiss_kirki_notice', 'keon_toolset_handle_kirki_notice_dismiss' ); |
| 113 |
|
| 114 |
/** |
| 115 |
* Installs Kirki 5.1.1 from the WordPress.org package URL and activates it. |
| 116 |
* Replaces any existing Kirki installation in wp-content/plugins/kirki. |
| 117 |
* |
| 118 |
* @since 2.4.8 |
| 119 |
*/ |
| 120 |
function keon_toolset_handle_kirki_install() { |
| 121 |
if ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'activate_plugins' ) ) { |
| 122 |
wp_die( esc_html__( 'You are not allowed to perform this action.', 'keon-toolset' ) ); |
| 123 |
} |
| 124 |
|
| 125 |
check_admin_referer( 'keon_toolset_install_kirki' ); |
| 126 |
|
| 127 |
require_once ABSPATH . 'wp-admin/includes/file.php'; |
| 128 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 129 |
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; |
| 130 |
|
| 131 |
$skin = new Automatic_Upgrader_Skin(); |
| 132 |
$upgrader = new Plugin_Upgrader( $skin ); |
| 133 |
$result = $upgrader->install( |
| 134 |
KEON_TOOLSET_KIRKI_PACKAGE_URL, |
| 135 |
array( |
| 136 |
'overwrite_package' => true, |
| 137 |
) |
| 138 |
); |
| 139 |
|
| 140 |
$redirect = wp_get_referer(); |
| 141 |
if ( empty( $redirect ) ) { |
| 142 |
$redirect = admin_url( 'plugins.php' ); |
| 143 |
} |
| 144 |
|
| 145 |
if ( is_wp_error( $result ) ) { |
| 146 |
set_transient( |
| 147 |
'keon_toolset_kirki_install_notice', |
| 148 |
array( |
| 149 |
'success' => false, |
| 150 |
'text' => sprintf( |
| 151 |
/* translators: 1: Kirki version, 2: Error message. */ |
| 152 |
__( 'Could not install Kirki %1$s: %2$s', 'keon-toolset' ), |
| 153 |
KEON_TOOLSET_KIRKI_VERSION, |
| 154 |
$result->get_error_message() |
| 155 |
), |
| 156 |
), |
| 157 |
60 |
| 158 |
); |
| 159 |
wp_safe_redirect( $redirect ); |
| 160 |
exit; |
| 161 |
} |
| 162 |
|
| 163 |
if ( false === $result ) { |
| 164 |
set_transient( |
| 165 |
'keon_toolset_kirki_install_notice', |
| 166 |
array( |
| 167 |
'success' => false, |
| 168 |
'text' => sprintf( |
| 169 |
/* translators: %s: Kirki version number. */ |
| 170 |
__( 'Kirki %s installation failed. Please try again or install the plugin manually under Plugins → Add New.', 'keon-toolset' ), |
| 171 |
KEON_TOOLSET_KIRKI_VERSION |
| 172 |
), |
| 173 |
), |
| 174 |
60 |
| 175 |
); |
| 176 |
wp_safe_redirect( $redirect ); |
| 177 |
exit; |
| 178 |
} |
| 179 |
|
| 180 |
$activation = activate_plugin( KEON_TOOLSET_KIRKI_PLUGIN_FILE, '', false, true ); |
| 181 |
|
| 182 |
if ( is_wp_error( $activation ) ) { |
| 183 |
set_transient( |
| 184 |
'keon_toolset_kirki_install_notice', |
| 185 |
array( |
| 186 |
'success' => false, |
| 187 |
'text' => sprintf( |
| 188 |
/* translators: 1: Kirki version, 2: Error message. */ |
| 189 |
__( 'Kirki %1$s was installed but could not be activated automatically: %2$s Please activate it on the Plugins screen.', 'keon-toolset' ), |
| 190 |
KEON_TOOLSET_KIRKI_VERSION, |
| 191 |
$activation->get_error_message() |
| 192 |
), |
| 193 |
), |
| 194 |
60 |
| 195 |
); |
| 196 |
wp_safe_redirect( $redirect ); |
| 197 |
exit; |
| 198 |
} |
| 199 |
|
| 200 |
set_transient( |
| 201 |
'keon_toolset_kirki_install_notice', |
| 202 |
array( |
| 203 |
'success' => true, |
| 204 |
'text' => sprintf( |
| 205 |
/* translators: %s: Kirki version number. */ |
| 206 |
__( 'Kirki %s has been installed and activated successfully.', 'keon-toolset' ), |
| 207 |
KEON_TOOLSET_KIRKI_VERSION |
| 208 |
), |
| 209 |
), |
| 210 |
60 |
| 211 |
); |
| 212 |
wp_safe_redirect( $redirect ); |
| 213 |
exit; |
| 214 |
} |
| 215 |
// add_action( 'admin_post_keon_toolset_install_kirki', 'keon_toolset_handle_kirki_install' ); |
| 216 |
|
| 217 |
/** |
| 218 |
* One-time admin notice after attempting to install Kirki from the compatibility notice. |
| 219 |
* |
| 220 |
* @since 2.4.8 |
| 221 |
*/ |
| 222 |
function keon_toolset_kirki_install_result_notice() { |
| 223 |
if ( ! current_user_can( 'activate_plugins' ) ) { |
| 224 |
return; |
| 225 |
} |
| 226 |
|
| 227 |
$payload = get_transient( 'keon_toolset_kirki_install_notice' ); |
| 228 |
if ( false === $payload || ! is_array( $payload ) || empty( $payload['text'] ) ) { |
| 229 |
return; |
| 230 |
} |
| 231 |
|
| 232 |
delete_transient( 'keon_toolset_kirki_install_notice' ); |
| 233 |
|
| 234 |
$class = ! empty( $payload['success'] ) ? 'notice-success' : 'notice-error'; |
| 235 |
printf( |
| 236 |
'<div class="notice %1$s is-dismissible"><p>%2$s</p></div>', |
| 237 |
esc_attr( $class ), |
| 238 |
esc_html( $payload['text'] ) |
| 239 |
); |
| 240 |
} |
| 241 |
// add_action( 'admin_notices', 'keon_toolset_kirki_install_result_notice', 5 ); |
| 242 |
|
| 243 |
/** |
| 244 |
* Resets dismissed state for the Kirki compatibility notice. |
| 245 |
* |
| 246 |
* @since 2.4.8 |
| 247 |
*/ |
| 248 |
function keon_toolset_handle_kirki_notice_reset() { |
| 249 |
if ( ! current_user_can( 'manage_options' ) ) { |
| 250 |
wp_die( esc_html__( 'You are not allowed to perform this action.', 'keon-toolset' ) ); |
| 251 |
} |
| 252 |
|
| 253 |
check_admin_referer( 'keon_toolset_reset_kirki_notice' ); |
| 254 |
delete_option( 'keon_toolset_kirki_notice_dismissed' ); |
| 255 |
|
| 256 |
$redirect_url = wp_get_referer(); |
| 257 |
if ( empty( $redirect_url ) ) { |
| 258 |
$redirect_url = admin_url(); |
| 259 |
} |
| 260 |
|
| 261 |
wp_safe_redirect( $redirect_url ); |
| 262 |
exit; |
| 263 |
} |
| 264 |
// add_action( 'admin_post_keon_toolset_reset_kirki_notice', 'keon_toolset_handle_kirki_notice_reset' ); |
| 265 |
|
| 266 |
/** |
| 267 |
* Prints Kirki version compatibility notice markup. |
| 268 |
* |
| 269 |
* @since 2.4.8 |
| 270 |
*/ |
| 271 |
function keon_toolset_kirki_version_notice_markup() { |
| 272 |
$can_install = current_user_can( 'install_plugins' ) && current_user_can( 'activate_plugins' ); |
| 273 |
?> |
| 274 |
|
| 275 |
<h2><?php esc_html_e( 'Theme Compatibility Notice:', 'keon-toolset' ); ?></h2> |
| 276 |
<p> |
| 277 |
<?php esc_html_e( 'We strongly recommend using Kirki 5.1.1 as it is stable and fully compatible with our theme. Please temporarily avoid updating beyond 5.1.1 (including latest version 5.2.3) for now due to known issues, and we will update compatibility once resolved.', 'keon-toolset' ); ?><br/> |
| 278 |
<?php if ( $can_install ) : ?> |
| 279 |
<?php esc_html_e( 'Install and activate Kirki version 5.1.1:', 'keon-toolset' ); ?> |
| 280 |
<a href="<?php echo esc_url( keon_toolset_kirki_install_action_url() ); ?>"> |
| 281 |
<?php esc_html_e( 'Install Kirki 5.1.1', 'keon-toolset' ); ?> |
| 282 |
</a> |
| 283 |
<?php else : ?> |
| 284 |
<?php esc_html_e( 'Please ask a site administrator to install Kirki version 5.1.1.', 'keon-toolset' ); ?> |
| 285 |
<?php endif; ?> |
| 286 |
</p> |
| 287 |
<p> |
| 288 |
<a class="button button-secondary" href="<?php echo esc_url( keon_toolset_kirki_notice_dismiss_url() ); ?>"> |
| 289 |
<?php esc_html_e( 'Dismiss', 'keon-toolset' ); ?> |
| 290 |
</a> |
| 291 |
</p> |
| 292 |
<?php |
| 293 |
} |
| 294 |
|
| 295 |
/** |
| 296 |
* Shows Kirki compatibility notice on wp-admin dashboard pages. |
| 297 |
* |
| 298 |
* @since 2.4.8 |
| 299 |
*/ |
| 300 |
function keon_toolset_kirki_admin_notice() { |
| 301 |
if ( keon_toolset_kirki_notice_is_dismissed() ) { |
| 302 |
return; |
| 303 |
} |
| 304 |
|
| 305 |
?> |
| 306 |
<div class="notice notice-warning is-dismissible"> |
| 307 |
<?php keon_toolset_kirki_version_notice_markup(); ?> |
| 308 |
</div> |
| 309 |
<?php |
| 310 |
} |
| 311 |
// add_action( 'admin_notices', 'keon_toolset_kirki_admin_notice' ); |
| 312 |
|
| 313 |
/** |
| 314 |
* Injects Kirki compatibility notice in Customizer controls panel. |
| 315 |
* |
| 316 |
* @since 2.4.8 |
| 317 |
*/ |
| 318 |
function keon_toolset_kirki_customizer_notice_script() { |
| 319 |
if ( keon_toolset_kirki_notice_is_dismissed() ) { |
| 320 |
return; |
| 321 |
} |
| 322 |
|
| 323 |
$dismiss_url = esc_url( keon_toolset_kirki_notice_dismiss_url() ); |
| 324 |
$can_install = current_user_can( 'install_plugins' ) && current_user_can( 'activate_plugins' ); |
| 325 |
$install_url = $can_install ? esc_url( keon_toolset_kirki_install_action_url() ) : ''; |
| 326 |
$title_text = esc_html__( 'Theme Compatibility Notice:', 'keon-toolset' ); |
| 327 |
$message_text = esc_html__( 'We strongly recommend using Kirki 5.1.1 as it is stable and fully compatible with our theme. Please temporarily avoid updating beyond 5.1.1 (including latest version 5.2.3) for now due to known issues, and we will update compatibility once resolved.', 'keon-toolset' ); |
| 328 |
$link_label = esc_html__( 'Install and activate Kirki version 5.1.1:', 'keon-toolset' ); |
| 329 |
$link_text = esc_html__( 'Install Kirki 5.1.1', 'keon-toolset' ); |
| 330 |
$no_cap_text = esc_html__( 'Please ask a site administrator to install Kirki version 5.1.1.', 'keon-toolset' ); |
| 331 |
$dismiss_text = esc_html__( 'Dismiss', 'keon-toolset' ); |
| 332 |
$close_text = esc_html__( 'Close this notice.', 'keon-toolset' ); |
| 333 |
|
| 334 |
?> |
| 335 |
<script> |
| 336 |
( function() { |
| 337 |
function insertKirkiNotice() { |
| 338 |
if ( document.getElementById( 'keon-toolset-customizer-kirki-notice' ) ) { |
| 339 |
return; |
| 340 |
} |
| 341 |
|
| 342 |
var container = document.querySelector( '#customize-theme-controls .wp-full-overlay-sidebar-content' ); |
| 343 |
if ( ! container ) { |
| 344 |
container = document.querySelector( '#customize-theme-controls' ); |
| 345 |
} |
| 346 |
if ( ! container ) { |
| 347 |
return; |
| 348 |
} |
| 349 |
|
| 350 |
var notice = document.createElement( 'div' ); |
| 351 |
notice.id = 'keon-toolset-customizer-kirki-notice'; |
| 352 |
notice.className = 'notice notice-warning is-dismissible'; |
| 353 |
notice.style.margin = '12px'; |
| 354 |
|
| 355 |
var dismissButton = document.createElement( 'button' ); |
| 356 |
dismissButton.type = 'button'; |
| 357 |
dismissButton.className = 'notice-dismiss'; |
| 358 |
dismissButton.innerHTML = '<span class="screen-reader-text"><?php echo esc_js( $close_text ); ?></span>'; |
| 359 |
dismissButton.addEventListener( 'click', function( event ) { |
| 360 |
event.preventDefault(); |
| 361 |
notice.style.display = 'none'; |
| 362 |
} ); |
| 363 |
|
| 364 |
notice.innerHTML = '<p><strong><?php echo esc_js( $title_text ); ?></strong> <?php echo esc_js( $message_text ); ?><br><?php if ( $can_install ) : ?><?php echo esc_js( $link_label ); ?> <a href="<?php echo esc_url( $install_url ); ?>"><?php echo esc_js( $link_text ); ?></a><?php else : ?><?php echo esc_js( $no_cap_text ); ?><?php endif; ?></p><p><a class="button button-secondary" href="<?php echo esc_url( $dismiss_url ); ?>"><?php echo esc_js( $dismiss_text ); ?></a></p>'; |
| 365 |
notice.appendChild( dismissButton ); |
| 366 |
|
| 367 |
var activeThemeSection = document.getElementById( 'customize-section-themes' ); |
| 368 |
if ( activeThemeSection && activeThemeSection.parentNode ) { |
| 369 |
if ( activeThemeSection.nextSibling ) { |
| 370 |
activeThemeSection.parentNode.insertBefore( notice, activeThemeSection.nextSibling ); |
| 371 |
} else { |
| 372 |
activeThemeSection.parentNode.appendChild( notice ); |
| 373 |
} |
| 374 |
} else { |
| 375 |
var upsellSection = document.getElementById( 'accordion-section-theme_upsell' ); |
| 376 |
if ( upsellSection && upsellSection.parentNode ) { |
| 377 |
upsellSection.parentNode.insertBefore( notice, upsellSection ); |
| 378 |
} else { |
| 379 |
container.insertBefore( notice, container.firstChild ); |
| 380 |
} |
| 381 |
} |
| 382 |
} |
| 383 |
|
| 384 |
if ( document.readyState === 'loading' ) { |
| 385 |
document.addEventListener( 'DOMContentLoaded', insertKirkiNotice ); |
| 386 |
} else { |
| 387 |
insertKirkiNotice(); |
| 388 |
} |
| 389 |
|
| 390 |
// Customizer panes can render asynchronously. |
| 391 |
setTimeout( insertKirkiNotice, 400 ); |
| 392 |
setTimeout( insertKirkiNotice, 1200 ); |
| 393 |
}() ); |
| 394 |
</script> |
| 395 |
<?php |
| 396 |
} |
| 397 |
// add_action( 'customize_controls_print_footer_scripts', 'keon_toolset_kirki_customizer_notice_script', 1 ); |
| 398 |
|
| 399 |
function keon_toolset_remove_prime_slider_admin_hooks() { |
| 400 |
global $wp_filter; |
| 401 |
|
| 402 |
if ( ! isset( $wp_filter['admin_init'] ) ) { |
| 403 |
return; |
| 404 |
} |
| 405 |
|
| 406 |
foreach ( $wp_filter['admin_init']->callbacks as $priority => $callbacks ) { |
| 407 |
foreach ( $callbacks as $key => $callback ) { |
| 408 |
if ( |
| 409 |
is_array( $callback['function'] ) && |
| 410 |
is_object( $callback['function'][0] ) && |
| 411 |
$callback['function'][0] instanceof \PrimeSlider\Admin && |
| 412 |
$callback['function'][1] === 'admin_biggopti_script' |
| 413 |
) { |
| 414 |
unset( $wp_filter['admin_init']->callbacks[$priority][$key] ); |
| 415 |
} |
| 416 |
} |
| 417 |
} |
| 418 |
} |
| 419 |
add_action( 'init', function() { |
| 420 |
if ( class_exists( '\PrimeSlider\Prime_Slider_Loader' ) ) { |
| 421 |
add_action( 'admin_init', 'keon_toolset_remove_prime_slider_admin_hooks', 0 ); |
| 422 |
} |
| 423 |
}, 99 ); |
| 424 |
|
| 425 |
function keon_toolset_remove_elementskit_admin_notices() { |
| 426 |
global $wp_filter; |
| 427 |
|
| 428 |
if ( ! isset( $wp_filter['admin_notices'] ) ) { |
| 429 |
return; |
| 430 |
} |
| 431 |
|
| 432 |
foreach ( $wp_filter['admin_notices']->callbacks as $priority => $callbacks ) { |
| 433 |
foreach ( $callbacks as $key => $callback ) { |
| 434 |
if ( |
| 435 |
is_array( $callback['function'] ) && |
| 436 |
is_object( $callback['function'][0] ) && |
| 437 |
$callback['function'][0] instanceof \Oxaim\Libs\Notice && |
| 438 |
$callback['function'][1] === 'get_notice' |
| 439 |
) { |
| 440 |
try { |
| 441 |
$obj = $callback['function'][0]; |
| 442 |
$ref = new \ReflectionProperty( $obj, 'notice_id' ); |
| 443 |
$notice_id = $ref->getValue( $obj ); |
| 444 |
|
| 445 |
if ( strpos( $notice_id, 'wpmet-jhanda' ) === 0 ) { |
| 446 |
unset( $wp_filter['admin_notices']->callbacks[$priority][$key] ); |
| 447 |
} |
| 448 |
} catch ( \ReflectionException $e ) { |
| 449 |
// property not found, skip |
| 450 |
} |
| 451 |
} |
| 452 |
} |
| 453 |
} |
| 454 |
} |
| 455 |
if ( class_exists( 'ElementsKit_Lite' ) ) { |
| 456 |
add_action( 'admin_notices', 'keon_toolset_remove_elementskit_admin_notices', 0 ); |
| 457 |
} |
| 458 |
|
| 459 |
function keon_toolset_remove_elementor_admin_hooks() { |
| 460 |
global $wp_filter; |
| 461 |
|
| 462 |
if ( ! class_exists( '\Elementor\Modules\Promotions\Conversion_Banner' ) ) { |
| 463 |
return; |
| 464 |
} |
| 465 |
global $wp_filter; |
| 466 |
if ( empty( $wp_filter['in_admin_header'] ) ) { |
| 467 |
return; |
| 468 |
} |
| 469 |
foreach ( $wp_filter['in_admin_header']->callbacks as $priority => $callbacks ) { |
| 470 |
foreach ( $callbacks as $key => $callback ) { |
| 471 |
if ( |
| 472 |
isset( $callback['function'] ) |
| 473 |
&& is_array( $callback['function'] ) |
| 474 |
&& $callback['function'][0] instanceof \Elementor\Modules\Promotions\Conversion_Banner |
| 475 |
&& $callback['function'][1] === 'render_banner_container' |
| 476 |
) { |
| 477 |
unset( $wp_filter['in_admin_header']->callbacks[ $priority ][ $key ] ); |
| 478 |
} |
| 479 |
} |
| 480 |
} |
| 481 |
} |
| 482 |
if ( class_exists( '\Elementor\Plugin' ) ) { |
| 483 |
add_action( 'current_screen', 'keon_toolset_remove_elementor_admin_hooks', 99 ); |
| 484 |
} |
| 485 |
|
| 486 |
if ( keon_toolset_theme_check( 'bosa' ) && !keon_toolset_theme_check( 'bosa-pro' ) ){ |
| 487 |
require KEON_TOOLSET_PATH . 'includes/class-bosa-pro-upgrade-notice.php'; |
| 488 |
} |
| 489 |
|
| 490 |
/** |
| 491 |
* Register all of the hooks related to the admin area functionality |
| 492 |
* of the plugin. |
| 493 |
* |
| 494 |
* @since 1.0.0 |
| 495 |
*/ |
| 496 |
$plugin_admin = keon_toolset_hooks(); |
| 497 |
add_filter( 'advanced_import_demo_lists', array( $plugin_admin,'keon_toolset_demo_import_lists'), 10, 1 ); |
| 498 |
add_filter( 'admin_menu', array( $plugin_admin, 'import_menu' ), 10, 1 ); |
| 499 |
add_filter( 'wp_ajax_keon_toolset_getting_started', array( $plugin_admin, 'install_advanced_import' ), 10, 1 ); |
| 500 |
add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_styles' ), 10, 1 ); |
| 501 |
add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_scripts' ), 10, 1 ); |
| 502 |
add_action( 'advanced_import_replace_term_ids', array( $plugin_admin, 'replace_term_ids' ), 20 ); |
| 503 |
add_action( 'advanced_import_replace_post_ids', array( $plugin_admin, 'replace_attachment_ids' ), 30 ); |
| 504 |
|
| 505 |
if( ( keon_toolset_theme_check( 'shoppable' ) && !keon_toolset_theme_check( 'hello-shoppable' ) ) || ( keon_toolset_theme_check( 'bosa-media-marketing' ) || keon_toolset_theme_check( 'bosa-business-firm' ) || keon_toolset_theme_check( 'bosa-photograph' ) || keon_toolset_theme_check( 'bosa-interior-design' ) || keon_toolset_theme_check( 'bosa-cleaning-service' ) || keon_toolset_theme_check( 'bosa-veterinary' ) || keon_toolset_theme_check( 'bosa-yoga' ) || keon_toolset_theme_check( 'bosa-logistics' ) || keon_toolset_theme_check( 'bosa-crypto' ) || keon_toolset_theme_check( 'bosa-clinic' ) || keon_toolset_theme_check( 'bosa-it-services' ) || keon_toolset_theme_check( 'bosa-university' ) || keon_toolset_theme_check( 'bosa-creative-agency' ) || keon_toolset_theme_check( 'bosa-garden-care' ) || keon_toolset_theme_check( 'bosa-construction-company' ) || keon_toolset_theme_check( 'bosa-travel-agency' ) || keon_toolset_theme_check( 'bosa-business-agency' ) || keon_toolset_theme_check( 'bosa-online-marketing' ) || keon_toolset_theme_check( 'bosa-law-firm' ) || keon_toolset_theme_check( 'bosa-veterinary-care' ) || keon_toolset_theme_check( 'bosa-ai-robotics-sector' ) || keon_toolset_theme_check( 'bosa-charity-firm' ) || keon_toolset_theme_check( 'bosa-restaurant-inn' ) || keon_toolset_theme_check( 'bosa-business-solutions' ) || keon_toolset_theme_check( 'bosa-portfolio-bio' ) || keon_toolset_theme_check( 'bosa-event-organizer' ) || keon_toolset_theme_check( 'bosa-ev-rental-car' ) || keon_toolset_theme_check( 'bosa-finance-consult' ) || keon_toolset_theme_check( 'bosa-beauty-care' ) || keon_toolset_theme_check( 'bosa-app-hub' ) || keon_toolset_theme_check( 'bosa-real-estate-group' ) || keon_toolset_theme_check( 'bosa-gym-fitness' ) || keon_toolset_theme_check( 'bosa-influencer-marketing' ) || keon_toolset_theme_check( 'bosa-handyman-services' ) || keon_toolset_theme_check( 'bosa-education-zone' ) || keon_toolset_theme_check( 'bosa-insurance-agency' ) || keon_toolset_theme_check( 'bosa-resort' ) || keon_toolset_theme_check( 'bosa-business-coach' ) || keon_toolset_theme_check( 'bosa-medical-care' ) || keon_toolset_theme_check( 'bosa-preschool' ) || keon_toolset_theme_check( 'bosa-tech-company' ) || keon_toolset_theme_check( 'bosa-driving-school' ) || keon_toolset_theme_check( 'bosa-advertising-agency' ) || keon_toolset_theme_check( 'bosa-cyber-security' ) || keon_toolset_theme_check( 'bosa-startup-business' ) || keon_toolset_theme_check( 'bosa-job-portal' ) || keon_toolset_theme_check( 'bosa-finance-company' ) || keon_toolset_theme_check( 'bosa-courier-service' ) || keon_toolset_theme_check( 'bosa-bakery' ) || keon_toolset_theme_check( 'bosa-health-coach' ) || keon_toolset_theme_check( 'bosa-freelancer' ) || keon_toolset_theme_check( 'bosa-political-party' ) || keon_toolset_theme_check( 'bosa-tattoo-studio' ) || keon_toolset_theme_check( 'bosa-saas' ) || keon_toolset_theme_check( 'bosa-spa-wellness' ) || keon_toolset_theme_check( 'bosa-pharmacy' ) || keon_toolset_theme_check( 'bosa-ai-marketing' ) ) ){ |
| 506 |
require KEON_TOOLSET_PATH . 'demo/base-install/base-install.php'; |
| 507 |
add_action('advanced_import_after_complete_screen', array( $plugin_admin, 'kt_advance_import' )); |
| 508 |
add_action('advanced_import_after_content_screen', array( $plugin_admin, 'kt_advance_import_transient' )); |
| 509 |
} |
| 510 |
|