Unable to Save Code Snippet with PHP Superglobals
-
I’m encountering an issue where I’m unable to save a code snippet that contains PHP superglobals (e.g.,
$_POST
,$_GET
, etc.) same goes to when i’m trying to save it within functions.php. The system seems to block the snippet whenever superglobals are present. Has anyone else experienced this or know of a solution to allow saving code with PHP superglobals?
Attached Image here:
https://www.dropbox.com/scl/fi/192x3984t0cad9brm0hcg/error-saving-code-snippet.png?rlkey=pcsk5rixft127arm22974v55k&st=mwu4gkit&dl=0
https://www.dropbox.com/scl/fi/gz36aknmwmye9rvb7epgm/status-code.png?rlkey=9jg9a1y24erzy67k5imm3ku0m&st=p18lkj9h&dl=0
There isn’t anything being returned within the Preview and Response tab under the Network tab
Preview Tab:
https://www.dropbox.com/scl/fi/v4xoobhrefkwo1380vf0s/preview.png?rlkey=xan2n9e8x0xm1glz9gcxf31bi&st=ruqd7hlq&dl=0
Network Tab
https://www.dropbox.com/scl/fi/546lacb8u0v1hf74a839y/response.png?rlkey=eiofziip4eoufxh91hka4kbtu&st=pak96gp9&dl=0
My current workaround is update the code within the functions.php and replace the file via ftp.
Once all the superglobals are being removed from the code snippet, then it can proceed to save again.
I’m using the free version of the Code Snippets plugin (https://codesnippets.pro/).
- You must be logged in to reply to this topic.