{"id":13673,"date":"2024-02-28T09:49:43","date_gmt":"2024-02-28T09:49:43","guid":{"rendered":"https:\/\/kriesi.at\/documentation\/enfold\/?p=13673"},"modified":"2024-07-01T11:05:31","modified_gmt":"2024-07-01T11:05:31","slug":"dismissible-admin-notice-box","status":"publish","type":"post","link":"https:\/\/kriesi.at\/documentation\/enfold\/dismissible-admin-notice-box\/","title":{"rendered":"Dismissible Admin Notice Box"},"content":{"rendered":"\n<style type=\"text\/css\" data-created_by=\"avia_inline_auto\" id=\"style-css-av-va7ug9-a06dfd24d782bb5ab48f564d3f311341\">\n#top .av-special-heading.av-va7ug9-a06dfd24d782bb5ab48f564d3f311341{\npadding-bottom:10px;\n}\nbody .av-special-heading.av-va7ug9-a06dfd24d782bb5ab48f564d3f311341 .av-special-heading-tag .heading-char{\nfont-size:25px;\n}\n.av-special-heading.av-va7ug9-a06dfd24d782bb5ab48f564d3f311341 .av-subheading{\nfont-size:15px;\n}\n<\/style>\n<div  class='av-special-heading av-va7ug9-a06dfd24d782bb5ab48f564d3f311341 av-special-heading-h2 blockquote modern-quote  avia-builder-el-0  el_before_av_hr  avia-builder-el-first  av-linked-heading'><h2 class='av-special-heading-tag '  itemprop=\"headline\"  >Dismissible Admin Notice Box<\/h2><div class=\"special-heading-border\"><div class=\"special-heading-inner-border\"><\/div><\/div><\/div>\n<div  class='hr av-4l81w9-b5b0c6c84c0027478f93af1559d8b8ff hr-default  avia-builder-el-1  el_after_av_heading  el_before_av_textblock '><span class='hr-inner '><span class=\"hr-inner-style\"><\/span><\/span><\/div>\n<section  class='av_textblock_section av-4eoa8p-49c749fa47049f63950c83b553a1aa26 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><h3>Overview<\/h3>\n<\/div><\/section>\n<section  class='av_textblock_section av-49omnd-88bd1095cce85da3f2461216c3c7abf2 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><p>Starting with Enfold 6.0 we add the possibility for developers to add and manage custom admin notice boxes.<\/p>\n<\/div><\/section>\n<div  class='hr av-3zu17t-4c9ac709971ad699358bf98d29d6cf55 hr-default  avia-builder-el-4  el_after_av_textblock  el_before_av_textblock '><span class='hr-inner '><span class=\"hr-inner-style\"><\/span><\/span><\/div>\n<section  class='av_textblock_section av-lt5m8u4q-72d982fc6ad7a434fe77d5278908cf23 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><h3>Features<\/h3>\n<\/div><\/section>\n<section  class='av_textblock_section av-28tuw9-11-9ff0ffad3a8bba77ef6053c2273c51f8 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><ul>\n<li>Dismiss notice on single user base or for all users<\/li>\n<li>Time limit or endless time to show notice to users before dismissed<\/li>\n<li>Show notices to users depending on capability<\/li>\n<li>WP default admin box styling classes supported or custom styling<\/li>\n<li>Content of notice box can be:\n<ul>\n<li>Plain text<\/li>\n<li>Simple HTML<\/li>\n<li>Complete custom HTML template<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>Special features for developers:<\/h5>\n<p>When loading a backend page append an argument to url, e.g.<\/p>\n<p>..\/wp-admin\/admin.php?page=avia&amp;avia-admin-notices=clear-all<\/p>\n<ul>\n<li>avia-admin-notices=clear-all<\/li>\n<\/ul>\n<p>Removes all notices and clears all internal markers which notices a user has dismissed. Good for testing if you want to show notices again after downgrading the theme version (to downgrade the theme version in the database &#8211; necessary to be recognized later &#8211;\u00a0 set WP_DEBUG = true and upload an older version of the theme or change version in style.css)<\/p>\n<ul>\n<li>avia-admin-notices=clear-current-user<\/li>\n<\/ul>\n<p>Clears all internal markers which notices the current user has dismissed. This brings back all notices (if not expired by the time limit)<\/p>\n<ul>\n<li>avia-admin-notices=clear-all-users<\/li>\n<\/ul>\n<p>Clears all internal markers which notices all users have dismissed.<\/p>\n<\/div><\/section>\n<div  class='hr av-3zu17t-12-b0cdb0a39da2b816eef46a33026407a2 hr-default  avia-builder-el-7  el_after_av_textblock  el_before_av_textblock '><span class='hr-inner '><span class=\"hr-inner-style\"><\/span><\/span><\/div>\n<section  class='av_textblock_section av-lt5m9cvz-61c96349190d1e69db7941f686ba8030 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><h3>Implementation<\/h3>\n<\/div><\/section>\n<section  class='av_textblock_section av-lt5m9k1l-c42e97e0691102e9a47dcbdcec8de8ac '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><ul>\n<li>Base class is implemented in enfold\\framework\\php\\class-admin-notices.php<\/li>\n<li>See enfold\\framework\\php\\admin-notices\\admin-notices-def.php for default boxes<\/li>\n<li>See enfold\\includes\\admin\\admin-notices\\admin-notices-def-enfold.php for Enfold specific box content, allows to override default box content<\/li>\n<li>Templates are placed in subfolder ..\\admin-notices\\templates but can be changed. We highly recommend to use full paths to template files because of include of php files<\/li>\n<\/ul>\n<\/div><\/section>\n<div  class='hr av-44uns9-df187422a01bfd236537b06799c19f83 hr-default  avia-builder-el-10  el_after_av_textblock  el_before_av_textblock '><span class='hr-inner '><span class=\"hr-inner-style\"><\/span><\/span><\/div>\n<section  class='av_textblock_section av-lt5ma3v4-3902cc034b66732f98e8323fcf2d7c2f '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><h3>Important Methods<\/h3>\n<\/div><\/section>\n<section  class='av_textblock_section av-lt5maaza-11a8d6762309bf7dd7b6569307512303 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><ul>\n<li>add_notice( $notice_keys, $expire = false, $save = true )<\/li>\n<li>delete_notice( $notice_keys = null, $save = true )<\/li>\n<li>get_current_notices()<\/li>\n<li>get_all_notices()<\/li>\n<li>get_default_expire_time( $context = &#8221; )<\/li>\n<\/ul>\n<\/div><\/section>\n<div  class='hr av-td3f49-a41519c855fcb65b46a6c4bbd8bab9de hr-default  avia-builder-el-13  el_after_av_textblock  el_before_av_textblock '><span class='hr-inner '><span class=\"hr-inner-style\"><\/span><\/span><\/div>\n<section  class='av_textblock_section av-lt5mank6-093b8cefed32cd66cfffa98dffa34418 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><h3>Filters<\/h3>\n<\/div><\/section>\n<section  class='av_textblock_section av-lt5maqqv-4d82799d2a1e71209836461594b3db68 '   itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/BlogPosting\" itemprop=\"blogPost\" ><div class='avia_textblock'  itemprop=\"text\" ><ul>\n<li>&#8216;avf_admin_notices_definition_files&#8217; &#8211; add paths to custom box definition files, this allows to override previous defined boxes<\/li>\n<li>&#8216;avf_init_admin_notices&#8217; &#8211; allows to alter the admin notice box array with definitions<\/li>\n<li>&#8216;avf_admin_notices_filtered&#8217; &#8211; for current user filtered notice boxes to display<\/li>\n<li>&#8216;avf_skip_output_single_notice&#8217; &#8211; skip output of notice box<\/li>\n<li>&#8216;avf_admin_notices_activate_cron&#8217; &#8211; enable\/disable cron job to clean up database for notice box show data and user meta<\/li>\n<li>&#8216;avf_admin_notice_default_expire_time&#8217; &#8211; change the default expire time (in a context)<\/li>\n<\/ul>\n<\/div><\/section>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"","footnotes":""},"categories":[2,12],"tags":[],"class_list":["post-13673","post","type-post","status-publish","format-standard","hentry","category-documentation","category-explore","documentation","explore"],"modified_by":"Yigit","_links":{"self":[{"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/posts\/13673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/comments?post=13673"}],"version-history":[{"count":13,"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/posts\/13673\/revisions"}],"predecessor-version":[{"id":13765,"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/posts\/13673\/revisions\/13765"}],"wp:attachment":[{"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/media?parent=13673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/categories?post=13673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kriesi.at\/documentation\/enfold\/wp-json\/wp\/v2\/tags?post=13673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}