开发者 |
bungeshea
ver3 lightbulbman codesnippetspro 0aksmith |
---|---|
更新时间 | 2023年7月5日 19:23 |
捐献地址: | 去捐款 |
WordPress版本: | 6.2.2 |
版权: | MIT |
版权网址: | 版权信息 |
functions.php
file.
Code Snippets Pro is now available, with full CSS, JavaScript, Gutenberg and Elementor integrations.
A snippet is a small chunk of PHP code that you can use to extend the functionality of a WordPress-powered website; essentially a mini-plugin with less load on your site.
Most snippet-hosting sites tell you to add snippet code to your active theme's functions.php
file, which can get rather long and messy after a while.
Code Snippets changes that by providing a GUI interface for adding snippets and actually running them on your site just as if they were in your theme's functions.php
file.
Quick overview of Code Snippets by Imran Siddiq
https://youtu.be/EMjIWjcYONk
Code Snippets provides graphical interface, similar to the Plugins menu, for managing snippets. Snippets can be activated and deactivated, just like plugins.
The snippet editor includes fields for a name, a visual editor-enabled description, tags to allow you to categorize snippets, and a full-featured code editor. Snippets can be exported for transfer to another site, either in JSON for later importing by the Code Snippets plugin, or in PHP for creating your own plugin or theme.
Comprehensive Code Snippets tutorial with practical examples by Ferdy Korpershoek
https://youtu.be/29jD2BcBX5w
If you have any feedback, issues, or suggestions for improvements please leave a topic in the Support Forum, join the community on Facebook, or check us out on GitHub.
If you like this plugin, or it is useful to you in some way, please consider reviewing it on WordPress.org.
wp-content/plugins/
folder of your WordPress installationA full list of our Frequently Asked Questions can be found at help.codesnippets.pro. You can recover your site by enabling the Code Snippets safe mode feature. Instructions for how to turn it on are available here: https://help.codesnippets.pro/article/12-safe-mode.
No, the snippets are stored in the WordPress database, independent of the theme and unaffected by WordPress upgrades.
If you enable the 'Complete Uninstall' option on the plugin settings page, Code Snippets will clean up all of its data when deleted through the WordPress 'Plugins' menu. This includes all stored snippets. If you would like to preserve the snippets, ensure they are exported first.
Yes! You can individually export a single snippet using the link below the snippet name on the 'Manage Snippets' page or bulk export multiple snippets using the 'Bulk Actions' feature. Snippets can later be imported using the 'Import Snippets' page by uploading the export file.
Yes. Click the checkboxes next to the snippets you want to export, and then choose Export to PHP from the Bulk Actions menu and click Apply. The generated PHP file will contain the exported snippets' code, as well as their name and description in comments.
You can run snippets across an entire multisite network by Network Activating Code Snippets through the Network Dashboard. You can also activate Code Snippets just on the main site, and then individually on other sites of your choice.
Snippets are stored in the wp_snippets
table in the WordPress database. The table name may differ depending on what your table prefix is set to.
You can get help with Code Snippets, report bugs or errors, and suggest new features and improvements either on the WordPress Support Forums or on GitHub
The best way to do this is to fork the repository on GitHub and send a pull request.
[code_snippet]
content shortcode to shortcode content.Ctrl
+/
or Cmd
+/
as shortcut for commenting out code in the snippet editor.code_snippets/export/filename
filter.:class
syntax to the code validator.function_exists
and class_exists
checks.