protected function setup_post_types() { $this->post_type = papi_to_array($this->post_type); // Set a default value to post types array // if we don't have a array or a empty array. if (empty($this->post_type)) { $this->post_type = ['page']; } if (count($this->post_type) === 1 && $this->post_type[0] === 'any') { $this->post_type = get_post_types('', 'names'); $this->post_type = array_values($this->post_type); } }