Skip to content

colormag-bxslider: Detect SiteOrigin Page Builder #94

@AlexGStapleton

Description

@AlexGStapleton

A user of Colormag pro has identified an issue where the Frontpage slider widgets won't work (nothing will appear) as expected when added inside of a SiteOrigin Page Builder instance - SiteOrigin Layouts Block, Layout Builder, SiteOrigin (Widgets Bundle) Layout Slider. I've come up with a fix to this but it appears the underlying code isn't in this repo so I'm not able to submit it. I've included the fix below. I would be happy to submit this fix to any repo, or for someone else to submit it on my behalf.

Open colormag-pro/inc/helper-functions.php and find:

if ( ! function_exists( 'colormag_elementor_active_page_check' ) ) :

	/**
	 * Check whether Elementor plugin is activated and is active on current page or not.
	 *
	 * @return bool
	 *
	 * @since ColorMag 2.2.3
	 */
	function colormag_elementor_active_page_check() {
		global $post;

		if ( defined( 'ELEMENTOR_VERSION' ) && get_post_meta( $post->ID, '_elementor_edit_mode', true ) ) {
			return true;
		}

		return false;
	}

endif;

Add after:

if ( ! function_exists( 'colormag_siteorigin_panels_active_page_check' ) ) :

	/**
	 * Check whether SiteOrigin Page Builder plugin is activated and is active on current page or not.
	 *
	 * @return bool
	 *
	 * @since ColorMag 
	 */
	function colormag_siteorigin_panels_active_page_check() {
		global $post;

		if ( defined( 'SITEORIGIN_PANELS_VERSION' ) && get_post_meta( $post->ID, 'panels_data', true ) ) {
			return true;
		}

		return false;
	}

endif;

Replace every instance of the following conditional:
if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() || colormag_elementor_active_page_check() ) {

With:
if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() || colormag_elementor_active_page_check() || colormag_siteorigin_panels_active_page_check() ) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions