-
Notifications
You must be signed in to change notification settings - Fork 184
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
6 changed files
with
107 additions
and
46 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,33 @@ | ||
<?php | ||
/** | ||
* SiteOrigin Page Builder compatibility with Popup Maker. | ||
* | ||
* Popup Maker uses a custom `the_content` filter `pum_popup_content`. | ||
* This compatibility function ensures that the Page Builder content is | ||
* displayed correctly within Popup Maker popups. | ||
* | ||
* @param string $content The original content of the popup. | ||
* @param int $popup_id The ID of the popup. | ||
* | ||
* @return string The modified content, or the original content. | ||
*/ | ||
function siteorigin_popup_maker( $content, $popup_id ) { | ||
|
||
if ( empty( $popup_id ) || ! is_numeric( $popup_id ) ) { | ||
return $content; | ||
} | ||
|
||
$panels_data = get_post_meta( (int) $popup_id, 'panels_data', true ); | ||
if ( empty( $panels_data ) ) { | ||
return $content; | ||
} | ||
|
||
$panel_content = SiteOrigin_Panels::renderer()->render( | ||
$popup_id, | ||
true, | ||
$panels_data | ||
); | ||
|
||
return $panel_content ? $panel_content : $content; | ||
} | ||
add_filter( 'pum_popup_content', 'siteorigin_popup_maker', 10, 2 ); |
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