function wp_init()
 {
     if (!post_type_exists($this->post_type)) {
         ecf_conf_error("Unexsiting post type: {$this->post_type}");
     }
     if (is_admin()) {
         $should_show_filter = false;
         # for custom post types and pages
         if (isset($_GET['post_type']) && $_GET['post_type'] == $this->current_post_type) {
             $should_show_filter = true;
         }
         # for regular posts
         if (!isset($_GET['post_type']) && $this->current_post_type == 'post') {
             $should_show_filter = true;
         }
         if ($this->is_filter_on_view_all && $should_show_filter) {
             add_action('restrict_manage_posts', array(&$this, 'print_view_all_filters'));
             add_action('pre_get_posts', array(&$this, 'filter_view_all_entries'));
         }
     }
 }
示例#2
0
 function show_on_level($level)
 {
     if ($level < 0) {
         ecf_conf_error('Invalid level limitation (' . $level . ')');
     }
     $this->level_limit = $level;
 }