Plugin Directory

Changeset 2637083


Ignore:
Timestamp:
11/29/2021 09:36:59 PM (4 years ago)
Author:
efreja
Message:

Fix for MSV block that may not show in block search field

Location:
music-sheet-viewer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • music-sheet-viewer/trunk/music-sheet-viewer.php

    r2625804 r2637083  
    88 * License:        GPL3
    99 * License URI:    https://www.gnu.org/licenses/gpl-3.0.html
    10  * Version:        3.2
     10 * Version:        3.2.1
    1111
    1212Copyright Etienne Frejaville 2018, 2019, 2020, 2021
     
    3030    class MusicSheetViewerPlugin
    3131    {
    32         const MSV_VERSION = '3.2';
     32        const MSV_VERSION = '3.2.1';
    3333       
    3434        const MSV_SHORTCODE = 'pn_msv';
     
    134134        {
    135135            add_action('wp_enqueue_scripts', array($this,'hook_javascript'));
     136            // enqueue block assets on the front-end and the editor
     137            add_action('enqueue_block_assets', array($this,'register_block'));
    136138            add_shortcode (self::MSV_SHORTCODE, array($this, 'process_shortcode'));
    137139            add_filter('upload_mimes', array($this, 'allowed_mimetypes'), 1, 1);
     
    140142            add_action('wp_ajax_readfile', array($this, 'read_score_file'));
    141143            add_action('wp_ajax_nopriv_readfile', array($this, 'read_score_file'));
    142             $this->register_block();
    143144        }
    144145       
     
    146147         * Register MSV Block
    147148         */
    148         protected function register_block()
     149        public function register_block()
    149150        {
    150151            // Skip block registration if Gutenberg is not enabled/merged.
    151152            if (!function_exists('register_block_type')) {
     153                error_log('Music Sheet Viewer ERROR : Cannot register block : Function register_block_type does not exist');
    152154                return;
    153155            }
    154156           
    155             wp_register_script('music-sheet-viewer-pn-msv',
     157            wp_enqueue_script('music-sheet-viewer-pn-msv',
    156158                               plugins_url('js/block.js', __FILE__),
    157159                               array(
     
    165167            // !!!! _ forbidden in extension/bloc
    166168            // https://github.com/WordPress/gutenberg/issues/13074
    167             register_block_type(self::MSV_BLOCK, array(
     169            if (false == register_block_type(self::MSV_BLOCK, array(
    168170                                                                   'editor_script' => 'music-sheet-viewer-pn-msv',
    169171                                                                   'render_callback' => array($this, 'process_block'),
     
    203205                                                                   ]
    204206                                                                   )
    205                                 );
     207                                             )
     208                ) error_log("Music Sheet Viewer ERROR : Cannot register block type: ".self::MSV_BLOCK);
    206209        }
    207210       
  • music-sheet-viewer/trunk/readme.txt

    r2625804 r2637083  
    7878== Changelog ==
    7979
     80= 3.2.1 =
     81* Fix for MSV block that may not show in block search field
     82
    8083= 3.2 =
    8184* Embedding of Leland font from MuseScore
Note: See TracChangeset for help on using the changeset viewer.