function widget($args, $instance) { add_filter('widget_pages_args', array($this, 'handbook_post_type')); parent::widget($args, $instance); remove_filter('widget_pages_args', array($this, 'handbook_post_type')); }