-
Notifications
You must be signed in to change notification settings - Fork 182
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
15 changed files
with
350 additions
and
352 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,12 @@ | ||
<?php | ||
// AIOSEO compatibility. We need to add their widgets to a sidebar | ||
// to ensure they're useable in Page Builder. | ||
function siteorigin_panels_load_aioseo_widgets( $sidebars = array() ) { | ||
$sidebars['aio_pb_compat'] = array( | ||
'aioseo-breadcrumb-widget', | ||
'aioseo-html-sitemap-widget', | ||
); | ||
|
||
return $sidebars; | ||
} | ||
add_filter( 'sidebars_widgets', 'siteorigin_panels_load_aioseo_widgets', 10, 1 ); |
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,55 @@ | ||
<?php | ||
if ( ! function_exists( 'em_content' ) ) { | ||
return; | ||
} | ||
|
||
$em_pb_removed = false; | ||
|
||
/** | ||
* Disable Page Builder for Events Manager post types. | ||
* | ||
* This function checks if the current post is an Events Manager post type | ||
* and if Page Builder is enabled for it. If both conditions are met, it | ||
* disables Page Builder for the content. This is done to prevent Page Builder | ||
* from interfering with the Events Manager content, and vice versa. | ||
* | ||
* `loop_start` is used due to when the Events Manager plugin sets up its | ||
* content replacement. | ||
* | ||
* @return void | ||
*/ | ||
function siteorigin_panels_event_manager_loop_start() { | ||
$em_post_types = array( 'event-recurring', 'event' ); | ||
|
||
// Is the current post an $em_post_types post? | ||
$post_type = get_post_type(); | ||
if ( ! in_array( $post_type, $em_post_types ) ) { | ||
return; | ||
} | ||
|
||
// Is Page Builder enabled for Events Manager post types? | ||
$pb_post_types = siteorigin_panels_setting( 'post-types' ); | ||
if ( empty( $pb_post_types ) || ! array_intersect( $em_post_types, $pb_post_types ) ) { | ||
return; | ||
} | ||
|
||
global $em_pb_removed; | ||
$em_pb_removed = true; | ||
|
||
add_filter( 'siteorigin_panels_filter_content_enabled', '__return_false' ); | ||
} | ||
add_action( 'loop_start', 'siteorigin_panels_event_manager_loop_start' ); | ||
|
||
/** | ||
* Re-enable Page Builder for `the_content` filter if it | ||
* was disabled at the start of the loop. | ||
*/ | ||
function siteorigin_panels_event_manager_loop_end() { | ||
global $em_pb_removed; | ||
|
||
if ( $em_pb_removed ) { | ||
remove_filter( 'siteorigin_panels_filter_content_enabled', '__return_false' ); | ||
} | ||
|
||
} | ||
add_action( 'loop_end' , 'siteorigin_panels_event_manager_loop_end' ); |
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
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
Oops, something went wrong.