Skip to content

Commit

Permalink
Merge pull request #21 from firetreedesign/v1.0.17
Browse files Browse the repository at this point in the history
Added compatibility with WordPress 5.8
  • Loading branch information
danielmilner committed Jul 20, 2021
2 parents 8cc8b42 + 1092088 commit aa4c34b
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 42 deletions.
4 changes: 2 additions & 2 deletions ft-rockpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <support@rockpresswp.com>
* Author URI: https://rockpresswp.com/
* Text Domain: ft-rockpress
Expand Down Expand Up @@ -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
Expand Down
100 changes: 62 additions & 38 deletions includes/class-rockpress-blocks.php
Original file line number Diff line number Diff line change
@@ -1,51 +1,75 @@
<?php
/**
* Blocks Initializer
*
*
* Enqueue CSS/JS of all the blocks.
*
*
* @since 1.0.11
* @package RockPress
*/

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* RockPress Blocks class
*/
/**
* RockPress Blocks class
*/
class RockPress_Blocks {

/**
* Initialize the class
*
* @since 1.0.11
*
* @return void
*/
public static function init() {
add_filter( 'block_categories', __CLASS__ . '::block_categories', 10, 2 );
}
/**
* Initialize the class
*
* @since 1.0.11
*
* @return void
*/
public static function init() {
if ( version_compare( $GLOBALS['wp_version'], '5.8alpha', '>=' ) ) {
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();
RockPress_Blocks::init();
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down

0 comments on commit aa4c34b

Please sign in to comment.