-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgame-review.php
47 lines (39 loc) · 1.63 KB
/
game-review.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
40
41
42
43
44
45
46
47
<?php
/**
* Plugin Name: Game Review Block
* Description: Add a review rating block with a score from 1 to 10 to your post. Adds schema.org meta data for Rich Results in search engines.
* Requires PHP: 7.0
* Version: 4.3.3
* Author: Marc Tönsing
* Author URI: https://toensing.com
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: game-review-block
*/
require dirname(__FILE__). '/src/review-box/callback.php';
require dirname(__FILE__). '/src/random-game/callback.php';
require dirname(__FILE__). '/src/game-list/callback.php';
require dirname(__FILE__). '/src/game-table/callback.php';
/**
* Registers the block using the metadata loaded from the `block.json` file.
* Behind the scenes, it registers also all assets so they can be enqueued
* through the block editor in the corresponding context.
*
* @see https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/writing-your-first-block-type/
*/
function game_review_block_init()
{
register_block_type(plugin_dir_path(__FILE__) . 'build/review-box/', [
'render_callback' => 'render_review_box'
]);
register_block_type(plugin_dir_path(__FILE__) . 'build/random-game/', [
'render_callback' => 'render_random_game'
]);
register_block_type(plugin_dir_path(__FILE__) . 'build/game-list/', [
'render_callback' => 'render_game_list'
]);
register_block_type(plugin_dir_path(__FILE__) . 'build/game-table/', [
'render_callback' => 'render_game_table'
]);
}
add_action('init', 'game_review_block_init');