Added ability to squash breadcrumbs on any member db related page
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 21 Jan 2016 21:34:01 +0000 (16:34 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 21 Jan 2016 21:34:01 +0000 (16:34 -0500)
setup/frontHooks.php

index f93f124..10b3268 100644 (file)
@@ -48,4 +48,13 @@ add_filter('init', function() {
     }
 });
 
-?>
\ No newline at end of file
+// Squash Bread Crumbs if using Breadcrumb NavXT plugin -- NEED TO CREATE A MANAGEMENT OPTION FOR THIS TO TURN IT ON/OFF
+$plugin_name = 'glm-member-db/glm-member-db.php';
+if (is_plugin_active($plugin_name)) {
+    add_action('bcn_after_fill', function($trail) {
+        global $post;
+        if (strpos($post->post_content, '[glm-member') !== false) {
+            $trail->breadcrumbs = array();
+        }
+    });
+}
\ No newline at end of file