PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / trunk
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites vtrunk
4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 2.6.1 All 38 releases
← All changes | inc/layout/components.php +23 -0 2.6.1trunk View file →
@@ -16,11 +16,34 @@
16 16 function register_components() {
17 17 $blocks_lists = array();
18 18
19 19 $templates = apply_filters( 'blockspare_template_library', $blocks_lists );
20 + $get_templates = get_posts(array('post_type'=>'bs_templates','posts_per_page'=>-1));
21 + if(!empty($get_templates)){
22 + foreach($get_templates as $res){
23 + //$get_meta = get_post_meta($res->ID,'bs_template_category');
24 + $array=array(
25 + 'type' => 'templates',
26 + //'item' =>($get_meta)?$get_meta:$res->post_title,
27 + 'item' =>[$res->post_title],
28 + 'key' => 'bs_template_'.$res->ID,
29 + 'name' =>$res->post_title,
30 + 'blockLink'=> get_the_permalink($res->ID),
31 + 'content' =>$res->post_content
32 + );
20 33
34 +
35 +
36 + array_push($templates,$array);
37 +
38 + }
39 + }
40 +
41 +
42 +
21 43 if(!empty($templates)){
22 44 foreach($templates as $temp){
45 +
23 46 blockspare_register_layout_component($temp);
24 47 }
25 48 }
26 49