-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Blocks Initializer | ||
* | ||
* Enqueue CSS/JS of all the blocks. | ||
* | ||
* @since 1.0.11 | ||
* @package RockPress | ||
*/ | ||
|
||
// Exit if accessed directly. | ||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* 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 ); | ||
} | ||
|
||
/** | ||
* 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' ), | ||
), | ||
) | ||
); | ||
} | ||
} | ||
RockPress_Blocks::init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters