Home>Support>Technical changes cause issue with page builder since update 2.29.17 for shortcodes

Technical changes cause issue with page builder since update 2.29.17 for shortcodes

The issue is the following:

When loading page content on another page via a shortcode the HTML tags are outputted as content instead of paragraphs and images see issue on our test environment (newest version of the page builder is active along with the widget bundle):

https://ibb.co/pdqLFWk

https://scdiscoveries700.e.wpstage.net/about/
HTTP User: blogvault
HTTP Pass: 7efc4f77

Scroll a little bit down and click on one of these team members to see the issue.
https://ibb.co/rbCnhFt

When you check the live website, which still uses the previous version this issue doesn’t occur:

https://www.scdiscoveries.com/about/

Scroll a little bit down and click on one of these team members to compare with the updated plugin above.
https://ibb.co/rbCnhFt

I tried to disable all the other plugins, but came to the conclusion this issue is caused by the newest version 2.29.17 its changes.

Website specs:
Php version 8.0
Theme Vantage

The custom shortcode in question:

funtions.php

// Team part
function team_part($atts) {
$default = array( 'id' => '', );
$id = shortcode_atts($default, $atts);
$number = $id['id'];
$page = get_post($number);

return do_shortcode($page->post_content);
}
add_shortcode('team', 'team_part');

Shortcode (used inside the tab widget from the widget bundle):
https://ibb.co/cYcdt9z

I’m looking for a solution to be able to update the plugin, I don’t really know why HTML is being stripped like and tags.

Much appreciated!

Sidenote: We made the popups like this with CSS, we added the content on a different pages so the member sections can be loaded into a tab via shortcode and on different pages managed on one page. The popup is done in CSS to increase the performance and lower the need of .js.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 3 months, 19 days ago Alex S
    Hi, I Work Here

    Hi,

    Thanks for getting in touch. We made a change in a previous Page Builder update to prevent a potential security issue related to the fallback content – this is why certain things are being stripped from output. This had a downside in that the fallback version of certain widgets wouldn’t display like they previously did. That downside is unfortunately unavoidable on our end, and to work around it you’ll need to make a change on your end.

    To resolve this issue on your end, I recommend changing your shortcode to:

    function team_part( $atts ) {
    	$default = array( 'id' => '', );
    	$id = shortcode_atts( $default, $atts );
    	$post_id = (int) $id['id'];
    
    	if ( class_exists( 'SiteOrigin_Panels' ) && get_post_meta( $post_id, 'panels_data', true ) ) {
    		return SiteOrigin_Panels::renderer()->render( $post_id );
    	} else {
    		return apply_filters( 'the_content', get_post( $post_id )->post_content );
    	}
    }
    add_shortcode('team', 'team_part');
    

    This change will make Page Builder render the other page rather than outputting the fallback content. If the Page Builder is disabled, the fallback content will still be output.

    Kind regards,
    Alex

  2. 3 months, 16 days ago jijonline

    Legend!

    This worked like a charm, thank you very much for your time and help!

  3. 3 months, 16 days ago Alex S
    Hi, I Work Here

    Hi Jijonline,

    It’s great to hear that helped! :)
    Please feel free to open a new thread if anything else comes up.

    Kind regards,
    Alex

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More