shortcode working fine until given a custom name
-
Hi,
this might be a strange problem :I started using woody snippet free, and created this shortcode :
<?php $html='[fusion_builder_column type="1_1" layout="1_1" center_content="no" min_height="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="cta-bloc-intext" id="" background_color="#ffffff" background_image_id="" background_position="right bottom" background_repeat="no-repeat" background_blend_mode="none" first="true" last="true" margin_bottom="30px" padding_top="30px" padding_right="30px" padding_bottom="30px" padding_left="30px" hover_type="none" border_position="all" link=""][fusion_text hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="cta-bloc-intext-title" id=""]'.$title.' [/fusion_text][fusion_text hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="cta-bloc-intext-text" id=""]'.$content.'[/fusion_text][/fusion_builder_column]'; echo do_shortcode($html); ?>Basically its use was to call pre-stylized elements from the theme I’m using and populating it with contents, it needed do_shortcode() to work (if not it’ll just paste the theme elements as plain text).
This worked fine until I bought the premium version, and gave it a custom name. So now when I call so the shortcode created a fatal error.(it’s in french but it’s pretty self explanatory) :
Une erreur de type E_PARSE a été causée dans la ligne 1 du fichier /var/www/wordpress/wp-content/plugins/woody-ad-snippets-premium/includes/shortcodes/shortcode-custom.php(114) : eval()’d code. Message d’erreur : syntax error, unexpected ‘margin’ (T_STRING)
So to resume :
– The shortcode as [wbcr_php_snippet id=”xx”] works fine
– Same code but with [custom_name] breaks my website_____________________________________________________
Here are some more details about my wordpress site
WordPress version 5.4.2
Theme : Avada (version 6.2.3)
Plugin version : Woody ad snippets premium (version 1.0.6)
PHP version 7.3.19-1~deb10u1Thanks for your help
The topic ‘shortcode working fine until given a custom name’ is closed to new replies.