From: Anthony Talarico Date: Thu, 29 Nov 2018 20:03:21 +0000 (-0500) Subject: adding shortcode for landing page blocks output X-Git-Tag: v1.6.2^2~10 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=42b0e65e5546b9507dcb1267dbc2faa58355da06;p=WP-Plugins%2Fglm-blocks.git adding shortcode for landing page blocks output --- 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