From eed3f50d20890baea87b98f5f92a619b90988788 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Fri, 14 Apr 2017 15:01:33 -0400 Subject: [PATCH] New filter for the glm_blocks, markup added to list.html --- functions.php | 14 ++++++++++++ glm-member-db/views/front/members/list.html | 24 ++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 7c69d9a..b5b559f 100644 --- a/functions.php +++ b/functions.php @@ -41,6 +41,20 @@ add_filter('glm-member-db-front-search-query', function() { } return $queryParts; }); + +add_filter('glm_blocks', function() { + if(function_exists('fetch_all_glm_blocks')) { + $blocks = fetch_all_glm_blocks(); + + return $blocks; + } + return false; +}); + +add_filter('glm_block_image', function($id) { + echo get_the_post_thumbnail($id, 'glm-block-image'); +}); + /** * Return the client info option for the given key * diff --git a/glm-member-db/views/front/members/list.html b/glm-member-db/views/front/members/list.html index 1e1e828..67b14dd 100644 --- a/glm-member-db/views/front/members/list.html +++ b/glm-member-db/views/front/members/list.html @@ -395,7 +395,29 @@ {/if} {*list_show_list*}
- :    -    D               Blocks go here + {$blocks = apply_filters('glm_blocks', '')} + {if $blocks} + {foreach $blocks as $block name="glm_block"} + + {if $smarty.foreach.glm_block.index % 3 == 0} +
+ {/if} + {if $block->url} + + {/if} +
+

{$block->post_title}

+ {apply_filters('glm_block_image', $block->ID)} +
+ {if $block->url} +
+ {/if} + {if $smarty.foreach.glm_block.index % 3 == 2} +
+ {/if} + {/foreach} + {/if} +