Move filter to itinerary plugin
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 12 Feb 2019 20:50:50 +0000 (15:50 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 12 Feb 2019 20:50:50 +0000 (15:50 -0500)
Moving this into the plugin.

functions.php

index f9116dc..20bfc17 100644 (file)
@@ -86,7 +86,7 @@ function glm_site_scripts()
         '0.0.25',
         true
     );
-    
+
     wp_enqueue_script('leaflet', get_template_directory_uri() . '/js/leaflet.js', array('jquery'), null, false);
     wp_enqueue_style('leaflet-style', get_template_directory_uri() . '/css/leaflet.css');
     wp_enqueue_script('leaflet-gesture', get_template_directory_uri() . '/js/leaflet-gesture-handling.min.js', array('jquery'), null, false);
@@ -245,9 +245,9 @@ add_action('thematic_searchloop', 'mytheme_search_loop');
 
 function has_children() {
     global $post;
-    
+
     $pages = get_pages('child_of=' . $post->ID);
-    
+
     if (count($pages) > 0):
       return true;
     else:
@@ -320,7 +320,7 @@ add_filter( 'rest_endpoints', function( $endpoints ){
                 endif;
                 $out .= '<div class="land-page-block-image" style="background: url('.$thumbnail.') no-repeat center center;"> <h5 class="glm-block-title">'.$block->post_title.'</h5></div>';
                 // $out .= '<div class="glm-block-frame"><div class="land-page-block-image" style="background: url('.$thumbnail.') no-repeat center center;"> <h5 class="glm-block-title">'.$block->post_title.'</h5></div></div>';
-      
+
                 if($block->url):
                     $out .= '</a>';
                 endif;
@@ -344,46 +344,46 @@ add_filter('events_search_widget', function(){
     return get_template_part("parts/events-search-widget");
 }, 10, 0);
 
-add_filter(
-    'glm-member-db-front-members-detail-mapTop',
-    function( $content, $member_id ){
-        global $wp, $config;
-        if ( isset( $_SESSION['travel-list'][$member_id] ) && $_SESSION['travel-list'][$member_id] ) {
-            $class     = 'list-view-link';
-            $span1     = 'view_trip1';
-            $label     = $config['settings']['view_label'];
-            $alt_label = $config['settings']['add_label'];
-            $is_view   = '1';
-        } else {
-            $class     = 'list-add-link';
-            $span1     = 'add_trip1';
-            $label     = $config['settings']['add_label'];
-            $alt_label = $config['settings']['view_label'];
-            $is_view   = '';
-        }
-        $load_page    = get_the_permalink( $config['settings']['itinerary_page'] );
-        $current_slug = add_query_arg( array(), $wp->request );
-        return $content . sprintf(
-            '<div class="memberSR">
-                <a class="glm-planner-button %s" data-id="%d" data-alt="%s" data-baseurl="%s" data-refpage="%s" data-view="%s" data-loadpage="%s">
-                    <span class="%s trip-alt-text">%s</span>
-                    <span class="trip2">Trip Planner</span>
-                </a>
-            </div>',
-            $class,
-            $member_id,
-            htmlspecialchars( $alt_label, ENT_QUOTES, 'UTF-8' ),
-            get_bloginfo( 'url' ),
-            $current_slug,
-            $is_view,
-            $load_page,
-            $span1,
-            $label
-        );
-    },
-    10,
-    2
-);
+// add_filter(
+//     'glm-member-db-front-members-detail-mapTop',
+//     function( $content, $member_id ){
+//         global $wp, $config;
+//         if ( isset( $_SESSION['travel-list'][$member_id] ) && $_SESSION['travel-list'][$member_id] ) {
+//             $class     = 'list-view-link';
+//             $span1     = 'view_trip1';
+//             $label     = $config['settings']['view_label'];
+//             $alt_label = $config['settings']['add_label'];
+//             $is_view   = '1';
+//         } else {
+//             $class     = 'list-add-link';
+//             $span1     = 'add_trip1';
+//             $label     = $config['settings']['add_label'];
+//             $alt_label = $config['settings']['view_label'];
+//             $is_view   = '';
+//         }
+//         $load_page    = get_the_permalink( $config['settings']['itinerary_page'] );
+//         $current_slug = add_query_arg( array(), $wp->request );
+//         return $content . sprintf(
+//             '<div class="memberSR">
+//                 <a class="glm-planner-button %s" data-id="%d" data-alt="%s" data-baseurl="%s" data-refpage="%s" data-view="%s" data-loadpage="%s">
+//                     <span class="%s trip-alt-text">%s</span>
+//                     <span class="trip2">Trip Planner</span>
+//                 </a>
+//             </div>',
+//             $class,
+//             $member_id,
+//             htmlspecialchars( $alt_label, ENT_QUOTES, 'UTF-8' ),
+//             get_bloginfo( 'url' ),
+//             $current_slug,
+//             $is_view,
+//             $load_page,
+//             $span1,
+//             $label
+//         );
+//     },
+//     10,
+//     2
+// );
 
 function get_county_page_id() {
     global $post;
@@ -398,13 +398,13 @@ function get_county_page_id() {
             // I'm a child of a county page
             $countyPageId = wp_get_post_parent_id( $post );
         }
-    } 
+    }
 
     return $countyPageId;
 }
 function get_county_page_children($countyPageId = false) {
     if ( $countyPageId ) {
-        $countyChildren = get_children( 
+        $countyChildren = get_children(
             array( 'post_parent'        => $countyPageId,
                     'post_status'       => 'publish',
                     'numberposts'       => -1,
@@ -414,4 +414,4 @@ function get_county_page_children($countyPageId = false) {
         ), ARRAY_A );
     }
     return $countyChildren;
-}
\ No newline at end of file
+}