public function check_attention_needed()
 {
     parent::check_attention_needed();
     // Check the pages to detect pages without ID
     $needs_attention = false;
     $all_pages = $this->get_customer_area_pages();
     foreach ($all_pages as $slug => $page) {
         $page_id = $this->get_page_id($slug);
         if ($page_id <= 0 || null == get_post($page_id)) {
             $needs_attention = true;
             break;
         }
     }
     if ($needs_attention) {
         $this->plugin->set_attention_needed('pages-without-id', __('Some pages of the customer area have not yet been created.', 'cuar'), 20);
     } else {
         $this->plugin->clear_attention_needed('pages-without-id');
     }
     // Check that we currently have a navigation menu
     $needs_attention = false;
     $menu_name = 'cuar_main_menu';
     $menu = null;
     if (($locations = get_nav_menu_locations()) && isset($locations[$menu_name])) {
         $menu = wp_get_nav_menu_object($locations[$menu_name]);
     }
     if ($menu == null) {
         $this->plugin->clear_attention_needed('nav-menu-needs-sync');
         $this->plugin->set_attention_needed('missing-nav-menu', __('The navigation menu for the customer area has not been created.', 'cuar'), 50);
     } else {
         $this->plugin->clear_attention_needed('missing-nav-menu');
     }
 }
Пример #2
0
 public function check_attention_needed()
 {
     parent::check_attention_needed();
     if ($this->plugin->is_warning_ignored('unconfigured-capabilities')) {
         return;
     }
     $this->plugin->set_attention_needed('unconfigured-capabilities', __('You have not yet configured the plugin permissions.', 'cuar'), 100);
 }