What exactly are WordPress code snippets?
Now, before I take a look at the WordPress plugin itself, I'd like to start by briefly clarifying what the Code Snippets are all about. After all, I can't just expect you to already know what exactly WordPress Code Snippets are and how they might help you and your blog. Don't worry, this thing is basically quite simple.
WordPress Code Snippets are PHP snippets, which are small fragments of code meant for functions.php in your WordPress theme. Through functions.php, you usually add smaller functions that don't necessarily require a separate plugin. Such snippets can be cosmetic, for example to hide the admin bar in the WordPress backend, or for practical purposes to change all file names to lowercase when uploading.
Basically, the snippets are simply PHP code and are always used when no extra plugin should be developed or installed. So for relatively small functions. Theoretically, you can fill the functions.php with extensive code because there is no real limit. But it is generally used for small code snippets. So much for that.
In the actual use of the code snippets, there is then the idea, as for actually all changes to the theme, to add them only via a child theme. This is done so that the snippets persist and the theme doesn't overwrite everything during an update. Nevertheless, the administration is of course a bit more complicated and you keep the overview in the functions.php only with appropriate comments in the code itself.
Der Original-Artikel erschien auf Code Snippets: Das praktische Plugin für eine Snippet-Verwaltung in WordPress.
Top comments (0)