{"id":4775,"date":"2025-03-17T09:31:41","date_gmt":"2025-03-17T09:31:41","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=4775"},"modified":"2025-03-17T09:50:02","modified_gmt":"2025-03-17T09:50:02","slug":"display-admin-area-warning-if-plugin-not-active","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/wordpress\/plugins\/display-admin-area-warning-if-plugin-not-active","title":{"rendered":"Display admin area warning if plugin not active"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\/\/**************************************************************************************\n\/\/**************************************************************************************\n\/\/********** DISPLAY WARNING IN WP ADIN AREA IF REQUIRED PLUGINGS ARE MISSING **********\n\/\/**************************************************************************************\n\/\/**************************************************************************************\nadd_action('admin_init', 'my_plugin_check_prerequisites_are_installed');        \/\/If using namespace: '\\MyNamespace\\my_plugin_check_prerequisites_are_installed'\nfunction my_plugin_check_prerequisites_are_installed()\n{\n  $plugin_slug = 'required_plugin_name\/required_plugin_name.php'; \/\/ Change this to the actual plugin slug\n\n  if (!is_plugin_active($plugin_slug))      \/\/Must be installed and active for a True response\n      add_action('admin_notices', 'my_plugin_check_prerequisites_warn_not_installed');        \/\/If using namespace: '\\MyNamespace\\my_plugin_check_prerequisites_warn_not_installed'\n}\n\nfunction my_plugin_check_prerequisites_warn_not_installed()\n{\n  ?>\n  &lt;div class=\"notice notice-error\">\n      &lt;p>&lt;strong>Warning:&lt;\/strong>Plugin &lt;em>required_plugin_name&lt;\/em> is not installed or activated. Some features may not work properly.&lt;\/p>\n  &lt;\/div>\n  &lt;?php\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[286,250],"tags":[],"class_list":["post-4775","post","type-post","status-publish","format-standard","hentry","category-admin-area","category-plugins"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/4775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=4775"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/4775\/revisions"}],"predecessor-version":[{"id":4779,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/4775\/revisions\/4779"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=4775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=4775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=4775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}