-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from eoxia-amandine/add_tag_eoblocks
#17 [Blocks] add: custom category eo-blocks
- Loading branch information
Showing
19 changed files
with
117 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* EO Blocks JS | ||
*/ | ||
jQuery(document).ready(function ($){ | ||
|
||
}); |
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 |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => 'a9726c820cd1a3452ab9'); | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '5b2f42ebe8e947d88ba7'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '9203b9b498c4b278a864'); | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '68857afa441b5853d4ad'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '6d8ffcd7dd206ab32f8e'); | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => 'e207756ca4fac7758397'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,70 @@ | ||
<?php | ||
/** | ||
* Plugin Settings. | ||
* | ||
* @author Eoxia | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
|
||
namespace EoBlocks\Includes; | ||
|
||
use EoBlocks\Includes\Admin\Eoblocks_Menu; | ||
use EoBlocks\Includes\Eoblocks_Settings; | ||
use EoBlocks\Includes\Eoblocks_Helper; | ||
|
||
if (!defined('ABSPATH')) { | ||
exit; | ||
} | ||
|
||
class Eoblocks { | ||
private static $initiated = false; | ||
/** | ||
* Class constructor | ||
* | ||
* @since 1.1.0 | ||
*/ | ||
public function __construct() { | ||
$eoblocks_menu = new Eoblocks_Menu(); | ||
$eoblocks_settings = new Eoblocks_Settings(); | ||
|
||
if ( ! self::$initiated ) { | ||
$this->init_hooks(); | ||
} | ||
} | ||
|
||
public function init_hooks() { | ||
self::$initiated = true; | ||
|
||
add_filter( 'block_categories_all', array( $this, 'create_block_category' ), 10, 2 ); | ||
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); | ||
} | ||
|
||
/** | ||
* Create Eoblocks block custom category | ||
* | ||
* @param $block_categories | ||
* @param $editor_context | ||
* @return mixed | ||
*/ | ||
public function create_block_category( $block_categories, $editor_context ) { | ||
if ( ! empty( $editor_context->post ) ) { | ||
array_unshift( | ||
$block_categories, | ||
array( | ||
'slug' => 'eo-blocks', | ||
'title' => __( 'EO Blocks', 'eo-blocks' ), | ||
) | ||
); | ||
} | ||
return $block_categories; | ||
} | ||
|
||
/** | ||
* Enqueue plugin scripts | ||
* @return void | ||
*/ | ||
public function enqueue_scripts() { | ||
wp_enqueue_script( 'eo-blocks-js', EO_BLOCKS_URL . 'assets/js/eoblocks.js', array( 'jquery') ); | ||
} | ||
} |