Changeset 2271190
- Timestamp:
- 03/31/2020 01:22:36 AM (6 years ago)
- File:
-
- 1 edited
-
advanced-bootstrap-blocks/trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
advanced-bootstrap-blocks/trunk/readme.txt
r2271189 r2271190 33 33 The example below may get you started but, please visit the [WordpPress Block Editor Handbook](https://developer.wordpress.org/block-editor/developers/block-api/block-templates/) to learn more about supercharging your WordPress themes with blocks templates. 34 34 35 <?php 36 if(in_array('advanced-bootstrap-blocks/advanced-bootstrap-blocks.php', apply_filters('active_plugins', get_option('active_plugins')))){ 37 // do stuff only if the Advanced Bootstrap Blocks plugin is active 38 add_action( 'init', 'advancedbootstrapblocks_register_page_template' ); 39 function advancedbootstrapblocks_register_page_template() { 40 $post_type_object = get_post_type_object( 'page' ); 41 $isFluid = get_theme_mod( 'understrap_container_type' ) === 'container-fluid'; 42 $post_type_object->template = [ 43 [ 'advanced-bootstrap-blocks/container', 44 ['className'=>'py-5', 'isWrapped' => $isFluid, 'isFluid' => false ], 45 [ 46 [ 'advanced-bootstrap-blocks/row', 47 [], 48 [ 49 [ 'advanced-bootstrap-blocks/column', 50 ['className'=>'col-md-8 offset-md-2 text-center'], 51 [ 52 ['core/heading', 53 [ 'className' => 'display-4', 'level' => 1, 'placeholder' => 'Hello, World!', ], 54 [] 55 ], 56 [ 'core/paragraph', 57 ['className' => 'lead', 'placeholder' => 'Lorem ipsum dolor sit amet.', ], 58 [] 35 <?php 36 if(in_array('advanced-bootstrap-blocks/advanced-bootstrap-blocks.php', apply_filters('active_plugins', get_option('active_plugins')))){ 37 // do stuff only if the Advanced Bootstrap Blocks plugin is active 38 add_action( 'init', 'advancedbootstrapblocks_register_page_template' ); 39 function advancedbootstrapblocks_register_page_template() { 40 $post_type_object = get_post_type_object( 'page' ); 41 $isFluid = get_theme_mod( 'understrap_container_type' ) === 'container-fluid'; 42 $post_type_object->template = [ 43 [ 'advanced-bootstrap-blocks/container', 44 ['className'=>'py-5', 'isWrapped' => $isFluid, 'isFluid' => false ], 45 [ 46 [ 'advanced-bootstrap-blocks/row', 47 [], 48 [ 49 [ 'advanced-bootstrap-blocks/column', 50 ['className'=>'col-md-8 offset-md-2 text-center'], 51 [ 52 ['core/heading', 53 [ 'className' => 'display-4', 'level' => 1, 'placeholder' => 'Hello, World!', ], 54 [] 59 55 ], 56 [ 'core/paragraph', 57 ['className' => 'lead', 'placeholder' => 'Lorem ipsum dolor sit amet.', ], 58 [] 59 ], 60 ] 60 61 ] 61 62 ] 62 63 ] 63 64 ] 64 ] 65 ] ,66 ];65 ], 66 ]; 67 } 67 68 } 68 }69 69 70 70
Note: See TracChangeset
for help on using the changeset viewer.