Could not create snippet. Request failed with status code 406
-
Hi,
after updating Code Snippets to the latest version (free) I can’t save my snippets. There’s an error: Could not create snippet. Request failed with status code 406
I can’t even save my old snippets, which previously worked (save) without any issues.
Please help.
The snippet I can’t save:
function apply_custom_css_for_specific_url() {
if (is_user_logged_in() && strpos($_SERVER[‘REQUEST_URI’], ‘/moje-konto/edit-account/’) !== false) {
echo ‘my custom CSS’;
}
}add_action(‘wp_head’, ‘apply_custom_css_for_specific_url’);
There’s following error in the console when I try to save the snippet: POST https://mydomain.com/wp-json/code-snippets/v1/snippets/34? 406 (Not Acceptable)
WordPress 6.5.2, PHP 8.1
- The topic ‘Could not create snippet. Request failed with status code 406’ is closed to new replies.