From: Steve Sutton Date: Tue, 12 Feb 2019 20:50:50 +0000 (-0500) Subject: Move filter to itinerary plugin X-Git-Tag: v1.0.0^2~108^2~4 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=4dd87e0cd660a6f132d1fbc689624808fa222ff9;p=WP-Themes%2Fuptravel.git Move filter to itinerary plugin Moving this into the plugin. --- diff --git a/functions.php b/functions.php index f9116dc..20bfc17 100644 --- a/functions.php +++ b/functions.php @@ -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 .= '
'.$block->post_title.'
'; // $out .= '
'.$block->post_title.'
'; - + if($block->url): $out .= ''; 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( - '
- - %s - Trip Planner - -
', - $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( +// '
+// +// %s +// Trip Planner +// +//
', +// $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 +}