一款高效的可扩展功能的wordpress代码片段管理插件,用户可以将一些常用功能的代码片段保存为单独的一个php文件并放置到插件wp-content/plugins/wp-china-tools/lib
An efficient and scalable wordpress code snippet management plugin. Users can save code snippets of some commonly used functions as a separate php file and place them in the plug-in wp-content / plugins / wp-china-tools / lib
/目录
/ Directory
在插件后台可以管理这些代码片段,并且插件会记录插件功能,时间长了用户也不会忘记自己加过什么代码。
These code snippets can be managed in the background of the plug-in, and the plug-in records the plug-in functions, and users will not forget what code they have added over time.
插件在载入用户 自定代码时会压缩代码合并所有代码并生成相关的集合文件,并以最高效的方式载入代码。
When the plug-in loads user-defined code, it compresses the code, merges all the code, generates related collection files, and loads the code in the most efficient way.
p>
(例)添加自定义模块:
(Example) Add custom module:
php
/*
/ *
Module Name: Google Fonts
Module Name: Google Fonts
Module Effect: 替换后台与登录界面的谷歌字体链接
Module Effect: Replace Google Fonts link in background and login interface
Module Author: 维7维3
Module Author: Dimension 7 Dimension 3
*/
* /
function cst_replace_open_sans() {
function cst_replace_open_sans () {
wp_deregister_style(‘open-sans’);
wp_deregister_style (‘open-sans’);
wp_register_style( ‘open-sans’, ‘//fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600’ );
wp_register_style (‘open-sans’, ‘//fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600’);
wp_enqueue_style( ‘open-sans’);
wp_enqueue_style (‘open-sans’);
}
}
add_action( ‘init’, ‘cst_replace_open_sans’ );
add_action (‘init’, ‘cst_replace_open_sans’);
将代码保存为php文件放置到wp-content/plugins/wp-china-tools/lib/目录,然后登录后台扫描并生成引用文件即可使用自定义模块了。
Save the code as a php file and place it in the wp-content / plugins / wp-china-tools / lib / directory, then log in to the background to scan and generate the reference file to use the custom module.
p>
官方网站:www.v7v3.com
Official website: www.v7v3.com p>
特色
Features h4>
- 记录代码片段功能
- Record code snippet function li>
- 功能可扩展
- Extensible features li>
- 高效的代码载入方式
- Efficient code loading method li>
- 可在线安装插件作者预先定义好的代码片段
- You can install pre-defined code snippets by plugin authors online li>
- 可视化的代码片段操作控制台
- Visual snippet operation console li>
- 高效精简的代码保证插件的稳定型以及运行效率。
- Efficient and streamlined code ensures the stability and efficiency of the plug-in.
li>
ol>