Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
plugins
CiviCRM Gutenberg Blocks
Commits
7111c34a
Commit
7111c34a
authored
Nov 30, 2019
by
Andrei Mondoc
Browse files
no need to enque civi resources
parent
b215d502
Changes
1
Hide whitespace changes
Inline
Side-by-side
civicrm-gutenberg-blocks.php
View file @
7111c34a
...
...
@@ -58,9 +58,6 @@ class CiviCRM_Gutenberg_Blocks {
// render block preview
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
add_action
(
'wp'
,
[
$this
,
'convert_serialised_block_to_shortcode'
],
5
);
...
...
@@ -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
* strings with their shorcode string
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment