Commit 7111c34a authored by Andrei Mondoc's avatar Andrei Mondoc
Browse files

no need to enque civi resources

parent b215d502
...@@ -58,9 +58,6 @@ class CiviCRM_Gutenberg_Blocks { ...@@ -58,9 +58,6 @@ class CiviCRM_Gutenberg_Blocks {
// render block preview // render block preview
add_filter( 'rest_post_dispatch', [ $this, 'render_block_preview' ], 10, 3); add_filter( 'rest_post_dispatch', [ $this, 'render_block_preview' ], 10, 3);
// add civicrm core resources
add_action( 'wp', [ $this, 'maybe_add_core_resources' ], 5);
// conver serialised block to shortcode // conver serialised block to shortcode
add_action( 'wp', [ $this, 'convert_serialised_block_to_shortcode' ], 5 ); add_action( 'wp', [ $this, 'convert_serialised_block_to_shortcode' ], 5 );
...@@ -355,30 +352,6 @@ class CiviCRM_Gutenberg_Blocks { ...@@ -355,30 +352,6 @@ class CiviCRM_Gutenberg_Blocks {
/**
* Fires 'front_end_page_load' to
* add CiviCRM's core resources on a page or post.
*
* @uses 'wp' action
*
* @since 0.1
*/
public function maybe_add_core_resources() {
if ( is_admin() ) return;
$object = get_queried_object();
if ( is_null( $object ) || ! $object instanceof WP_Post ) return;
if ( ! has_block( 'civicrm/civicrm-content-block', $object ) ) return;
add_action( 'wp', [ civi_wp(), 'front_end_page_load' ] );
}
/** /**
* Replaces all serslised content block * Replaces all serslised content block
* strings with their shorcode string * strings with their shorcode string
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment