Hi Clive,
Do you get this error page when saving a simpler snippet, like this one?
add_action ( 'bbp_theme_before_topic_form_content', function () {
echo 'before topic form';
}
Hi Shea, thank you, the plugin is not working at all now, I added the action you gave me and and I get a blank page, I used the define(‘CODE_SNIPPETS_SAFE_MODE’, true); to get back.
I have disabled all the snippets and the page loads when I enable any, including the one above I get a blank page.
Hi,
I have had some more problems and in the end I have deleted my test website and re installed it from backup.
I have installed the code snippet plugin and only added the one you suggest above. I am still getting a blank page. When I saved the snippet I got a message on my browser that something on the page was slowing my browser.
Adding the line define(‘CODE_SNIPPETS_SAFE_MODE’, true); to the wp-config.php worked after a while (caching).
but adding the snippet from my first post above still gives me the forbidden page
-
This reply was modified 7 years, 7 months ago by
Clivesmith.
-
This reply was modified 7 years, 7 months ago by
Clivesmith.
-
This reply was modified 7 years, 7 months ago by
Clivesmith.
My mistake, the snippet I posted above had a bit left off the end.
Please try this code instead:
add_action ( 'bbp_theme_before_topic_form_content', function () {
echo 'before topic form';
} );
Hi,
yep your piece of code does not give me forbidden page.
Clive
It looks like the forbidden page is only showing up when snippets you add have an error in them.
Try using this cleaned-up version of your original snippet:
add_action( 'bbp_theme_before_topic_form_content', function () {
$value = get_post_meta( bbp_get_topic_id(), 'bbp_extra_field1', true );
echo '<label for="bbp_extra_field1">hashtag</label><br>';
printf( '<input type="text" name="bbp_extra_field1" value="%s"><br>', $value );
$value = get_post_meta( bbp_get_topic_id(), 'bbp_extra_field2', true );
echo '<br><label for="bbp_extra_field1">Twitter Name</label><br>';
printf( '<input type="text" name="bbp_extra_field2" value="%s">', $value );
} );
HI,
Thanks, but that gives me the same error message
Clive
I’m really not sure what could be causing this. I have a feeling that it might be something specific to your server configuration, as the code I posted seems to work just fine when I test it out.