load.php ➔ give_blocks_category()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
1
<?php
2
// Exit if access directly.
3
if ( ! defined( 'ABSPATH' ) ) {
4
	exit;
5
}
6
7
/**
8
 * Add Custom Block Category for Give blocks
9
 */
10
function give_blocks_category( $categories, $post ) {
0 ignored issues
show
Unused Code introduced by
The parameter $post is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
11
    return array_merge(
12
        $categories,
13
        array(
14
            array(
15
                'slug' => 'give',
16
                'title' => __( 'Give', 'give' ),
17
            ),
18
        )
19
    );
20
}
21
add_filter( 'block_categories', 'give_blocks_category', 10, 2 );
22
23
/**
24
* Blocks
25
*/
26
require_once GIVE_PLUGIN_DIR . 'blocks/donation-form/class-give-donation-form-block.php';
27
require_once GIVE_PLUGIN_DIR . 'blocks/donation-form-grid/class-give-donation-form-grid-block.php';
28
require_once GIVE_PLUGIN_DIR . 'blocks/donor-wall/class-give-donor-wall.php';
29