From 1092088f1b5117a5b455747840b6788a36b03c51 Mon Sep 17 00:00:00 2001 From: Daniel Milner Date: Tue, 20 Jul 2021 08:45:44 -0700 Subject: [PATCH] Added compatibility with WordPress 5.8 --- ft-rockpress.php | 4 +- includes/class-rockpress-blocks.php | 100 +++++++++++++++++----------- readme.txt | 7 +- 3 files changed, 69 insertions(+), 42 deletions(-) diff --git a/ft-rockpress.php b/ft-rockpress.php index 689a348..af15cb5 100755 --- a/ft-rockpress.php +++ b/ft-rockpress.php @@ -3,7 +3,7 @@ * Plugin Name: RockPress * Plugin URI: https://rockpresswp.com/ * Description: Display information from Rock RMS on your WordPress site. - * Version: 1.0.16 + * Version: 1.0.17 * Author: RockPress * Author URI: https://rockpresswp.com/ * Text Domain: ft-rockpress @@ -66,7 +66,7 @@ class RockPress { * @var string * @since 1.0.0 */ - public $version = '1.0.15'; + public $version = '1.0.17'; /** * Main RockPress Instance diff --git a/includes/class-rockpress-blocks.php b/includes/class-rockpress-blocks.php index a0b0749..96214a0 100644 --- a/includes/class-rockpress-blocks.php +++ b/includes/class-rockpress-blocks.php @@ -1,51 +1,75 @@ =' ) ) { + add_filter( 'block_categories_all', __CLASS__ . '::block_categories_all', 10, 2 ); + } else { + add_filter( 'block_categories', __CLASS__ . '::block_categories', 10, 2 ); + } + } + + /** + * Register a new block category for RockPress. + * + * @since 1.0.11 + * + * @return array + */ + public static function block_categories( $categories, $post ) { + return array_merge( + $categories, + array( + array( + 'slug' => 'rockpress', + 'title' => __( 'RockPress', 'ft-rockpress' ), + ), + ) + ); + } - /** - * Register a new block category for RockPress. - * - * @since 1.0.11 - * - * @return void - */ - public static function block_categories( $categories, $post ) { - return array_merge( - $categories, - array( - array( - 'slug' => 'rockpress', - 'title' => __( 'RockPress', 'ft-rockpress' ), - ), - ) - ); - } + /** + * Register a new block category for RockPress. + * + * @since 1.0.17 + * @param array $block_categories Block categories. + * @param object $editor_context Editor context. + * @return array + */ + public static function block_categories_all( $block_categories, $editor_context ) { + array_push( + $block_categories, + array( + 'slug' => 'rockpress', + 'title' => __( 'RockPress', 'ft-rockpress' ), + 'icon' => null, + ) + ); + return $block_categories; + } } -RockPress_Blocks::init(); \ No newline at end of file +RockPress_Blocks::init(); diff --git a/readme.txt b/readme.txt index 4ca0dc2..e5547bc 100755 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: firetree, danielmilner Tags: church, rockrms, chms, rock rms Requires at least: 4.3 -Tested up to: 5.5 +Tested up to: 5.8 Requires PHP: 5.3 -Stable tag: 1.0.16 +Stable tag: 1.0.17 License: GPLv2 or later License URI: http://ww.gnu.org/licenses/gpl-2.0.html @@ -41,6 +41,9 @@ Extend the capabilities of RockPress with these add-ons: == Changelog == += 1.0.17 = +* Added compatibility with WordPress 5.8. + = 1.0.16 = * Fixed an issue when resetting an import.