File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Plugin Name: Be API - Default Popup Maker
4+ * Description: Hide Popup Maker filesystem cache alert
5+ * Version: 1.0
6+ * Author: BE API Technical team
7+ * Author URI: https://www.beapi.fr
8+ */
9+
10+ namespace BEAPI \Plugin_Defaults \Popup_Maker ;
11+
12+ add_filter ( 'pum_alert_list ' , __NAMESPACE__ . '\\strip_filesystem_cache_alert ' , 999 );
13+
14+ /**
15+ * Hide Popup Maker filesystem cache alert
16+ *
17+ * @param array $alerts Popup Maker alerts returned by apply_filters( 'pum_alert_list', [] ).
18+ * @return array
19+ */
20+ function strip_filesystem_cache_alert ( $ alerts ) {
21+ if ( empty ( $ alerts ) || ! is_array ( $ alerts ) ) {
22+ return $ alerts ;
23+ }
24+
25+ return array_values (
26+ array_filter (
27+ $ alerts ,
28+ static function ( $ alert ) {
29+ return ! isset ( $ alert ['code ' ] ) || 'pum_writeable_notice ' !== $ alert ['code ' ];
30+ }
31+ )
32+ );
33+ }
You can’t perform that action at this time.
0 commit comments