• Join the Best Wordpress and Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!

Shortcode Breaks the Editor

NetzPrinz

NetzPrinz

New Member
Hello Guys,

i have a problem with my shortcode.

I insert it over elementor shortcode widget on a template for a woocommerce single product page and it´s works fine in the frontend.
Go back to elementor editor in the backend i became the error "critical error"!

What is wrong? Can help?

Here is the code:

// Create Shortcode display-attributes
// Shortcode: [display-attributes]

function create_displayattributes_shortcode() {

global $post;
global $product;
$informationen = get_field( 'information', $post->ID );

ob_start(); ?>
<div class="single-product-extra-info">
<?php
echo wc_display_product_attributes( $product );
echo apply_filters( 'the_content', $information );
?>
</div>

<?php
$output = ob_get_clean();
return $output;

}
add_shortcode( 'display-attributes', 'create_displayattributes_shortcode' );


Thanks for your effort!!!
 

Latest Resources

Other Elementor Resources

elementor official

Still stuck? Ask the forum

Post your question with a screenshot and a link if you can, and a member will usually reply within a day. Free to join, no sales pitch.

Create a free account
Top