From: Anthony Talarico Date: Tue, 13 Nov 2018 14:56:55 +0000 (-0500) Subject: pages now associate with the links on the map X-Git-Tag: v1.0.0^2~25 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=0386eb0e59ada0fc228145812ea51a635d1497ba;p=WP-Plugins%2Fglm-member-db-county-map.git pages now associate with the links on the map --- diff --git a/models/front/map/display.php b/models/front/map/display.php index e254248..8bdc7ba 100644 --- a/models/front/map/display.php +++ b/models/front/map/display.php @@ -101,14 +101,27 @@ class GlmMembersFront_map_display extends GlmDataMapSettings { $sql = "SELECT * FROM " . GLM_MEMBERS_COUNTY_MAP_PLUGIN_DB_PREFIX . 'areas'; $areas = $this->wpdb->get_results($sql); + $args = array( + 'sort_order' => 'asc', + 'sort_column' => 'post_title', + 'hierarchical' => 0, + 'post_type' => 'page', + 'post_status' => 'publish' + ); + $results = get_pages($args); + foreach($results as $page){ + $pages[$page->ID]['name'] = $page->post_title; + $pages[$page->ID]['url'] = get_permalink($page->ID); + } wp_enqueue_style('admin-css', GLM_MEMBERS_COUNTY_MAP_PLUGIN_URL . 'css/front.min.css'); // Compile template data $templateData = array( - 'assets' => GLM_MEMBERS_COUNTY_MAP_PLUGIN_URL . 'assets/', - 'areas' => $areas + 'assets' => GLM_MEMBERS_COUNTY_MAP_PLUGIN_URL . 'assets/', + 'areas' => $areas, + 'pages' => $pages ); - + // Return status, any suggested view, and any data to controller return array( 'status' => true, diff --git a/views/front/map/display.html b/views/front/map/display.html index 7cef206..65a3197 100644 --- a/views/front/map/display.html +++ b/views/front/map/display.html @@ -9,6 +9,7 @@ \ No newline at end of file + + \ No newline at end of file