-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmrw-accordion.php
39 lines (33 loc) · 1 KB
/
mrw-accordion.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Plugin Name: MRW Accordion
* Description: An accessible accordion block that's a joy to edit
* Requires at least: 5.9
* Requires PHP: 7.0
* Version: 0.7.0
* Author: Mark Root-Wiley
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: mrw-accordion
* Update URI: false
*
* @package mrw-accordion
*/
namespace MRW\Accordion;
/**
* Registers the block using the metadata loaded from the `block.json` file.
*
* @see https://developer.wordpress.org/block-editor/tutorials/block-tutorial/writing-your-first-block-type/
*/
function block_init() {
register_block_type(
__DIR__,
array( 'render_callback' => __NAMESPACE__ . '\render_accordion' )
);
register_block_style('mrw/accordion', array(
'name' => 'plain',
'label' => _x('Plain', 'accordion block style', 'mrw-accordion')
));
}
add_action( 'init', __NAMESPACE__ . '\block_init' );
require( 'render-block.php' );