Changeset 2243966
- Timestamp:
- 02/13/2020 03:43:53 PM (6 years ago)
- Location:
- magadanski-similar-posts/trunk
- Files:
-
- 3 added
- 1 edited
-
blocks (added)
-
blocks/edit.css (added)
-
blocks/index.js (added)
-
magadanski-similar-posts.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
magadanski-similar-posts/trunk/magadanski-similar-posts.php
r1493815 r2243966 4 4 * Plugin URI: http://wordpress.org/plugins/magadanski-similar-posts/ 5 5 * Description: Shows similar posts ordered by the number of common categories. 6 * Version: 1. 2.46 * Version: 1.3 7 7 * Author: Georgi Popov a.k.a. Magadanski_Uchen 8 8 * Author URI: http://magadanski.com/ … … 30 30 * @const VERSION 31 31 */ 32 const VERSION = '1. 2.4';32 const VERSION = '1.3'; 33 33 34 34 /** … … 142 142 143 143 $this->vc_integration(); 144 $this->gutenberg_integration(); 144 145 } 145 146 … … 164 165 public function admin_enqueue_scripts() { 165 166 wp_enqueue_style('msp-admin', $this->plugin_url() . 'admin.css', array(), self::VERSION, 'all'); 167 wp_enqueue_style('msp-block', $this->plugin_url() . 'blocks/edit.css', array(), self::VERSION, 'all'); 166 168 } 167 169 … … 420 422 } 421 423 } 424 425 /** 426 * Gutenberg Integration 427 * 428 * Register a Gutenberg Block for WordPress 5+ 429 * 430 * @since 1.3 431 * @access public 432 * @return void 433 */ 434 public function gutenberg_integration() { 435 if (function_exists('register_block_type')) { 436 $script_dependencies = array( 437 'wp-blocks', 438 'wp-element', 439 'wp-server-side-render' 440 ); 441 442 wp_register_script('msp-block', $this->plugin_url() . 'blocks/index.js', $script_dependencies, self::VERSION); 443 444 $block_options = array( 445 'render_callback' => array(&$this, 'shortcode'), 446 'editor_script' => 'msp-block' 447 ); 448 449 register_block_type(__('Similar Posts', 'magadanski-similar-posts'), $block_options); 450 } 451 } 422 452 } 423 453
Note: See TracChangeset
for help on using the changeset viewer.