Plugin Directory

Changeset 2874497


Ignore:
Timestamp:
03/03/2023 08:49:26 PM (3 years ago)
Author:
blockprotocol
Message:

add version 0.0.2 of the plugin

Location:
blockprotocol
Files:
740 added
1 edited

Legend:

Unmodified
Added
Removed
  • blockprotocol/trunk/block-protocol.php

    r2873083 r2874497  
    22/**
    33 * @package blockprotocol
    4  * @version 0.0.1
     4 * @version 0.0.2
    55 */
    66/*
     
    1010Author: Block Protocol
    1111Author URI: https://blockprotocol.org/?utm_medium=organic&utm_source=wordpress_plugin-directory_blockprotocol-plugin_author-name
    12 Version: 0.0.1
    13 Requires at least: 5.0.0
     12Version: 0.0.2
     13Requires at least: 5.6.0
    1414Tested up to: 6.1.1
    1515License: AGPL-3.0
     
    1717*/
    1818
    19 const BLOCK_PROTOCOL_PLUGIN_VERISON = "0.0.1";
     19const BLOCK_PROTOCOL_PLUGIN_VERISON = "0.0.2";
    2020
    2121if (is_readable(__DIR__ . '/vendor/autoload.php')) {
     
    220220    wp_add_inline_script('blockprotocol-script', "block_protocol_data = " . json_encode($data));
    221221
    222     // finally, expand our existing block registration with the render callback
    223     register_block_type(
    224         "blockprotocol/block",
    225         [
    226             'render_callback' => 'block_dynamic_render_callback',
    227         ]
    228     );
     222    if (!WP_Block_Type_Registry::get_instance()->is_registered('blockprotocol/block')) {
     223        register_block_type(
     224            "blockprotocol/block",
     225            [
     226                'render_callback' => 'block_dynamic_render_callback',
     227            ]
     228        );
     229    }
    229230
    230231    // register and enqueue the script that registers a variation of our block for each BP block available
     
    248249function block_protocol_non_admin_post_scripts($post)
    249250{
    250     register_block_type(
    251         "blockprotocol/block",
    252         [
    253             'render_callback' => 'block_dynamic_render_callback',
    254         ]
    255     );
     251    if (!WP_Block_Type_Registry::get_instance()->is_registered('blockprotocol/block')) {
     252        register_block_type(
     253            "blockprotocol/block",
     254            [
     255                'render_callback' => 'block_dynamic_render_callback',
     256            ]
     257        );
     258    }
    256259
    257260    $render_asset_file = include(plugin_dir_path(__FILE__) . 'build/render.asset.php');
Note: See TracChangeset for help on using the changeset viewer.