From 42b0e65e5546b9507dcb1267dbc2faa58355da06 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 29 Nov 2018 15:03:21 -0500 Subject: [PATCH] adding shortcode for landing page blocks output --- glm-blocks.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/glm-blocks.php b/glm-blocks.php index 1fde095..20907d7 100644 --- a/glm-blocks.php +++ b/glm-blocks.php @@ -53,3 +53,33 @@ if (!function_exists('fetch_all_glm_blocks')) { return $frontController->fetchAllBlocks($catId); } } +function landing_page_blocks( $atts ) +{ + $out = ''; + extract(shortcode_atts( + array('category' => '-1'), $atts, 'glm-blocks') + ); + if(function_exists('fetch_all_glm_blocks')): + $category = filter_var($atts['category'], FILTER_VALIDATE_INT); + $blocks = fetch_all_glm_blocks($category); + $out .= ''; + endif; + return $out; +} +add_shortcode('glm-blocks', 'landing_page_blocks'); \ No newline at end of file -- 2.17.1