Plugin Author
Temyk
(@webtemyk)
Hello.
According to the message, the error is in one of your snippets, which is located on this page of the site. Check the snippet. Also in the latest version, the “Execute shortcodes in snippets” option was added to the plugin settings. If you use shortcodes in snippets, enable this option.
I enabled the option “Execute shortcodes in snippets”, but still the error occurred.
And the code snippet was always working till the new version of your plugin. I cannot find an error. Could you please check? I’m posting the snippet here:
if(isset($_GET['redirect']) && ($_GET['redirect'] == base64_encode('guest'))){
echo do_shortcode( "[dwqa-submit-question-form]" );
} else if(isset($_GET['success'])){
echo "<div class='submit-dwqa-question dwqa-container'> <p style='background-color: #dff0d8; padding: 5px; border: 1px solid #dff0d8; border-radius: 5px; display: block; color: #3c763d; text-align: center;'>Thanks for your question! You'll receive an email when we answer.</p></div>";
}
else{
if(!is_user_logged_in()) {
echo '<div id="ask-login-message">
<span style="font-size:18px;">Please login to ask a question.</span><br>
<a href="/login?redirect_to=/ask" class="button">Login</a><br>
<span style="font-size:18px;">New to this site?</span><br>
<a href="/memberships" class="button">Register Now (free)</a><br>';
echo "<a style='font-size:12px; cursor: pointer;' onclick='window.location.href=\"?redirect=".base64_encode("guest")."\"'>Continue as a guest</a>";
echo '</div>';
} else{
echo do_shortcode( "[dwqa-submit-question-form]" );
}
}
You can see this working on the live site here with Woody snippet version 2.3.7:
https://englicist.com/ask
Plugin Author
Temyk
(@webtemyk)
What if you disable the “Execute shortcodes in snippets ” option?
Plugin Author
Temyk
(@webtemyk)
if ( isset( $_GET['redirect'] ) && ( $_GET['redirect'] == base64_encode( 'guest' ) ) ) {
?>
[dwqa-submit-question-form]
<?php
} else if ( isset( $_GET['success'] ) ) {
echo "<div class='submit-dwqa-question dwqa-container'> <p style='background-color: #dff0d8; padding: 5px; border: 1px solid #dff0d8; border-radius: 5px; display: block; color: #3c763d; text-align: center;'>Thanks for your question! You'll receive an email when we answer.</p></div>";
} else {
if ( ! is_user_logged_in() ) {
echo '<div id="ask-login-message">
<span style="font-size:18px;">Please login to ask a question.</span><br>
<a href="/login?redirect_to=/ask" class="button">Login</a><br>
<span style="font-size:18px;">New to this site?</span><br>
<a href="/memberships" class="button">Register Now (free)</a><br>';
echo "<a style='font-size:12px; cursor: pointer;' onclick='window.location.href=\"?redirect=" . base64_encode( "guest" ) . "\"'>Continue as a guest</a>";
echo '</div>';
} else {
?>
[dwqa-submit-question-form]
<?php
}
}
You can also try this with the option enabled
Oh, I see! I just disabled the option and it works fine.
But wait! The shortcodes used in other snippets are not working now. They are printed as raw shortcodes as it should be.
Plugin Author
Temyk
(@webtemyk)
You need to bring everything to one view:
either you use do_shortcode () everywhere, and this option is disabled,
or you use shortcodes directly in the code everywhere, and this option is enabled.
You’re right. Now I get this. Thanks so much Artem.