• Resolved beppemanno

    (@beppemanno)


    Hi guys,
    sorry for this stupid question but he’s making me crazy…
    All the HTML attributes like “id” or “style” are removed from the echo output.
    For example I have a simple snippet like this:

    function dtpdp_elementor_shortcode( $atts ) {
        echo '<table id="myid" style="border:0px;">' .
         '  <tr>' .
         '    <td><strong>Struttura:</strong> '.get_field( "struttura" ).'</td>' .
         '    <td><strong>Tipo di terreno:</strong> '.get_field( "terreno_tipo" ).'</td>' .
         '  </tr>' .
         '</table>';
    }
    add_shortcode( 'dtpdp_elementor_template_output', 'dtpdp_elementor_shortcode' );

    The output is always a table without any id tags…
    <table>
    Where am I doing wrong?
    Thanks

    • This topic was modified 2 years, 9 months ago by beppemanno.
Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Try changing the echo to a return. Shortcodes should never display content by themselves, and always just return their output form the function.

Viewing 1 replies (of 1 total)
  • The topic ‘HTML tag attributes removed’ is closed to new replies.