Plugin Directory

Changeset 2271190


Ignore:
Timestamp:
03/31/2020 01:22:36 AM (6 years ago)
Author:
helpfuldev
Message:

Fix formatting issue with codeblock in README x3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • advanced-bootstrap-blocks/trunk/readme.txt

    r2271189 r2271190  
    3333The 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.
    3434
    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                                                []
    5955                                        ],
     56                                            [ 'core/paragraph',
     57                                                ['className' => 'lead', 'placeholder' => 'Lorem ipsum dolor sit amet.', ],
     58                                                []
     59                                            ],
     60                                        ]
    6061                                    ]
    6162                                ]
    6263                            ]
    6364                        ]
    64                     ]
    65                 ],
    66             ];
     65                    ],
     66                ];
     67            }
    6768        }
    68     }
    6969
    7070
Note: See TracChangeset for help on using the changeset viewer.