WordPress 3.7.1-web截屏插件整合教程-Xproer.ScreenCapture
2013-12-15 11:22
459 查看
插件下载(PHP):wordpress 3.7.1,
说明:由于许多插件可能使用相同钩子,导致冲突,所以提供手支方式整合。
1.上传插件目录。
说明:WordPress 3.7.1 使用的是TinyMCE4.x。插件目录必须是TinyMCE4.x的插件目录
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/624a9e7fe031d8ba6b75fc89906c8e9f.jpg)
2.在functions.php中增加插件初始化代码和编辑器工具栏按钮
为编辑器增加工具栏按钮
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/719988d1e0f7bb6753956118e2afdd34.jpg)
增加插件初始化代码:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/5e2bba10a64fc7498ef529bde0323d89.jpg)
示例代码:
//WordPaster插件-加载
function ScreenCapture_Plugin()
{
$plugins = array('screencapture'); //Add any more plugins you want to load here
$plugins_array = array();
//Build the response - the key is the plugin name, value is the URL to the plugin JS
foreach ($plugins as $plugin ) {
$plugins_array[ $plugin ] = plugins_url($plugin."/") . 'editor_plugin.js';
}
return $plugins_array;
}
add_filter('mce_external_plugins',"ScreenCapture_Plugin");
//WordPaster插件-初始化
function ScreenCapture_init(){
echo '<link type="text/css" rel="stylesheet" href="' . WP_PLUGIN_URL . '/wordpaster/css/ui-lightness/jquery-ui-1.8.11.custom.css" />'."\n";
echo '<script type="text/javascript" src="' . WP_PLUGIN_URL . '/wordpaster/js/jquery.min.js" charset="utf-8"></script>'."\n";
echo '<script type="text/javascript" src="' . WP_PLUGIN_URL . '/wordpaster/js/jquery-ui-1.8.11.custom.min.js"></script>'."\n";
//截屏插件
echo '<link type="text/css" rel="Stylesheet" href="' . WP_PLUGIN_URL . '/screencapture/css/ScreenCapture.css"/>'."\n";
echo '<script type="text/javascript" src="' . WP_PLUGIN_URL . '/screencapture/js/ScreenCapture.js" charset="utf-8"></script>'."\n";
echo '<script language="javascript" type="text/javascript">'."\n";
//截屏插件
echo ' var scpMgr = new CaptureManager();'."\n";
echo ' scpMgr.Init(null);'."\n";
echo '</script>';
}
add_action( 'admin_print_scripts', ScreenCapture_init' );
3.修改upload.php返回路径。
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/e2cef56fca91e4bd9e99b268ccab991a.jpg)
4.修改ScreenCapture.js中的PostUrl
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/2fab99ee0c5f0b6ead48343f2e14029c.jpg)
整合效果:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/5ed853b4c44e61cb93e45cf911d368ea.jpg)
说明:由于许多插件可能使用相同钩子,导致冲突,所以提供手支方式整合。
1.上传插件目录。
说明:WordPress 3.7.1 使用的是TinyMCE4.x。插件目录必须是TinyMCE4.x的插件目录
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/624a9e7fe031d8ba6b75fc89906c8e9f.jpg)
2.在functions.php中增加插件初始化代码和编辑器工具栏按钮
为编辑器增加工具栏按钮
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/719988d1e0f7bb6753956118e2afdd34.jpg)
增加插件初始化代码:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/5e2bba10a64fc7498ef529bde0323d89.jpg)
示例代码:
//WordPaster插件-加载
function ScreenCapture_Plugin()
{
$plugins = array('screencapture'); //Add any more plugins you want to load here
$plugins_array = array();
//Build the response - the key is the plugin name, value is the URL to the plugin JS
foreach ($plugins as $plugin ) {
$plugins_array[ $plugin ] = plugins_url($plugin."/") . 'editor_plugin.js';
}
return $plugins_array;
}
add_filter('mce_external_plugins',"ScreenCapture_Plugin");
//WordPaster插件-初始化
function ScreenCapture_init(){
echo '<link type="text/css" rel="stylesheet" href="' . WP_PLUGIN_URL . '/wordpaster/css/ui-lightness/jquery-ui-1.8.11.custom.css" />'."\n";
echo '<script type="text/javascript" src="' . WP_PLUGIN_URL . '/wordpaster/js/jquery.min.js" charset="utf-8"></script>'."\n";
echo '<script type="text/javascript" src="' . WP_PLUGIN_URL . '/wordpaster/js/jquery-ui-1.8.11.custom.min.js"></script>'."\n";
//截屏插件
echo '<link type="text/css" rel="Stylesheet" href="' . WP_PLUGIN_URL . '/screencapture/css/ScreenCapture.css"/>'."\n";
echo '<script type="text/javascript" src="' . WP_PLUGIN_URL . '/screencapture/js/ScreenCapture.js" charset="utf-8"></script>'."\n";
echo '<script language="javascript" type="text/javascript">'."\n";
//截屏插件
echo ' var scpMgr = new CaptureManager();'."\n";
echo ' scpMgr.Init(null);'."\n";
echo '</script>';
}
add_action( 'admin_print_scripts', ScreenCapture_init' );
3.修改upload.php返回路径。
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/e2cef56fca91e4bd9e99b268ccab991a.jpg)
4.修改ScreenCapture.js中的PostUrl
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/2fab99ee0c5f0b6ead48343f2e14029c.jpg)
整合效果:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202003/31/5ed853b4c44e61cb93e45cf911d368ea.jpg)
相关文章推荐
- Discuz! X2截屏插件整合教程-自动安装方法-Xproer.ScreenCapture
- Web截屏插件标准版发布-Xproer.ScreenCapture
- Discuz!X2截屏插件手动安装教程-Xproer.ScreenCapture
- Web截屏插件专业版发布-Xproer.ScreenCapturePro
- Web截屏插件专业版升级日志-Xproer.ScreenCapturePro
- Web截屏插件标准版升级日志.Xproer.ScreenCapture
- Discuz!X2截屏控件手动安装教程-Xproer.ScreenCapture
- Firefox截屏插件发布-Xproer.ScreenCapture
- Firefox截屏插件升级日志-Xproer.ScreenCapture
- WordPress-Word图片上传插件整合教程-Xproer.WordPaster
- Chrome截屏插件标准版发布-Xproer.ScreenCapture
- Chrome截屏插件升级日志-Xproer.ScreenCapture
- Web截屏控件布署文档-Xproer.ScreenCapture
- ScreenCapture手动卸载教程-Xproer.ScreenCapture
- WordPress 插件开发教程 Part 4 – 与WordPress整合
- WordPress 插件开发教程 – Part-4 – 与WordPress整合
- 手动安装Chrome截屏控件扩展-Xproer.ScreenCapture(ScreenCapture.crx)
- WordPress插件开发教程1
- activiti web流程设计器 工作流的 整合视频教程 SSM和独立部署
- activiti工作流的web流程设计器整合视频教程 SSM和独立部署