PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
wpdirectorykit / blocks / inc / block-share / block-share.php

block-share.php in WP Directory Kit 1.5.9, at blocks/inc/block-share/block-share.php

44 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: My Custom Block
4 Description: A custom block for my theme.
5 Version: 1.0
6 Author: Your Name
7 */
8
9 // Exit if accessed directly.
10 if (!defined('ABSPATH')) {
11 exit;
12 }
13
14 add_action('enqueue_block_editor_assets', function () {
15 if (is_user_logged_in()) {
16 wp_enqueue_script(
17 'wdk-block-share-backend',
18 WPDIRECTORYKIT_URL . '/blocks/inc/block-share/block.js',
19 array('wp-blocks', 'wp-element', 'wp-editor', 'wp-i18n', 'wp-api-fetch'),
20 23
21 );
22 }
23 });
24
25 add_action('wdk_block_block_share_enqueue_assets', function () {
26 wp_enqueue_script(
27 'wdk-block-share-frontend',
28 WPDIRECTORYKIT_URL . '/blocks/inc/block-share/frontend.js',
29 array(),
30 22
31 );
32 });
33
34
35 add_action('init', function ()
36 {
37 register_block_type('my-plugin/wdk-block-share', array(
38 'editor_script' => 'wdk-block-share',
39 'style' => 'wdk-block-share-style',
40 'editor_style' => 'wdk-block-share-editor',
41 ));
42 }
43 );
44