Skip to content

Instantly share code, notes, and snippets.

@chwnam
Last active June 14, 2024 05:19
Show Gist options
  • Save chwnam/0d43b8e919fad972a679d0537117f566 to your computer and use it in GitHub Desktop.
Save chwnam/0d43b8e919fad972a679d0537117f566 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: 엘리멘터 프로 라이센스 불일치 관리자 알림 제거
* Description: 엘리멘터 프로를 개발 사이트에서 임시로 활용할 때 사용하세요. 귀찮은 라이센스 관련 알림창을 제거합니다.
* Author: changwoo
* Author URI: https://blog.changwoo.pe.kr
*/
if (!defined('ABSPATH')) {
exit;
}
if(!function_exists('removeElemLicenseMismatchNotice')) {
function removeElemLicenseMismatchNotice() {
if (class_exists('ElementorPro\\Plugin')) {
$elem = \ElementorPro\Plugin::instance();
$admin = $elem->license_admin;
$hasMethod = method_exists($admin, 'admin_license_details');
$priority = has_action('admin_notices', [$admin, 'admin_license_details']);
if ($hasMethod && $priority) {
remove_action('admin_notices', [$admin, 'admin_license_details'], $priority);
}
}
}
}
add_action( 'init', 'removeElemLicenseMismatchNotice', 100 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment