| | |
| | | public function getDirectories():array |
| | | { |
| | | $directories = get_option(BASE.'directories'); |
| | | |
| | | if (!$directories) { |
| | | $directories = []; |
| | | //content |
| | |
| | | $title = $config['title']; |
| | | //Bail early if we've already created the page |
| | | $existing = new WP_Query([ |
| | | 'post_type' => BASE.'dash', |
| | | 'post_type' => BASE.'directory', |
| | | 'name' => sanitize_title($title), |
| | | 'posts_per_page' => 1, |
| | | ]); |
| | |
| | | // ]; |
| | | // } |
| | | // } |
| | | |
| | | if (!empty($created)) { |
| | | update_option(BASE.'directory_ids', $created); |
| | | } |
| | |
| | | protected function buildDirectoryList():array |
| | | { |
| | | $saved = get_option(BASE.'directory_list', []); |
| | | |
| | | if (empty($saved)) { |
| | | $all = new WP_Query([ |
| | | 'post_type' => BASE.'directory', |