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+ if ( ! defined ( 'ABSPATH ' ) ) {
13+ die ( 'Cannot access pages directly. ' );
14+ }
15+
16+ add_filter ( 'pum_alert_list ' , __NAMESPACE__ . '\\strip_filesystem_cache_alert ' , 999 );
17+
18+ /**
19+ * Hide Popup Maker filesystem cache alert
20+ *
21+ * @param array $alerts Popup Maker alerts returned by apply_filters( 'pum_alert_list', [] ).
22+ * @return array
23+ */
24+ function strip_filesystem_cache_alert ( $ alerts ) {
25+ if ( empty ( $ alerts ) || ! is_array ( $ alerts ) ) {
26+ return $ alerts ;
27+ }
28+
29+ return array_values (
30+ array_filter (
31+ $ alerts ,
32+ static function ( $ alert ) {
33+ return ! isset ( $ alert ['code ' ] ) || 'pum_writeable_notice ' !== $ alert ['code ' ];
34+ }
35+ )
36+ );
37+ }
You can’t perform that action at this time.
0 commit comments