Is it best to add custom code using Toolset's Custom Code Snippets option or by inserting the code into the Functions.php file? Are there any differences between these two methods? Pros and cons etc?
Minesh, according to that link, using Custom Code Snippets opens up a potential security issue. Does the same issue exist when using a functions.php file?
To protect each custom code file , we have following check.
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
I recommend you to use Toolset's Custom Code Snippets option as if you add custom code to functions.php file, lets say if you update the theme, there is the possibility that you may lose the data.
Thank you for the information and help so far Minesh.
How would I go about "converting" all my custom code from a functions.php file to Custom Code Snippets? Is it as simple as just copying it all across and pasting the above security check code at the top?
How would I go about "converting" all my custom code from a functions.php file to Custom Code Snippets? Is it as simple as just copying it all across and pasting the above security check code at the top?
==> Yes, you should just copy/paste it to custom code snippets BUT after the security check code line. Dont forget to activate it.