PluginProbe
Audio Player Block – Play Audio Beautifully on Any Page / trunk
Audio Player Block – Play Audio Beautifully on Any Page vtrunk
1.6.2 1.6.1 1.6.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 All 37 releases
audio-player-block / includes / Init.php

Init.php in Audio Player Block – Play Audio Beautifully on Any Page trunk, at includes/Init.php

37 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BPMP;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 class Init {
10 function __construct() {
11 add_action( 'init', [ $this, 'onInit' ] );
12 }
13
14 function onInit(){
15 register_block_type(BPMP_DIR_PATH . '/build');
16
17 register_post_type('audio_player_block', [
18 'label' => __( 'Audio Player', 'audio-player-block' ),
19 'labels' => [
20 'add_new' => _x( 'Add New', 'audio_player_block', 'audio-player-block' ),
21 'add_new_item' => __( 'Add New Player', 'audio-player-block' ),
22 'edit_item' => __( 'Edit Player', 'audio-player-block' ),
23 'not_found' => __( 'There was no player please add one', 'audio-player-block' )
24 ],
25 'show_in_rest' => true,
26 'public' => true,
27 'publicly_queryable' => false,
28 'menu_icon' => 'dashicons-format-audio',
29 'item_published' => 'Audio Player Block Published',
30 'item_updated' => 'Audio Player Block Updated',
31 'template' => [['bpmp/mp3-player']],
32 'template_lock' => 'all',
33 ]);
34
35 }
36
37 }