脚本宝典收集整理的这篇文章主要介绍了php – 以编程方式安装和激活WordPress插件,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
今天我使用一个带有wp-cli的shell循环来安装和@L_403_1@的插件
原始答案
为了激活,我使用了一些变体.假设我有三个想要激活的插件(“CForms”,“w3-total-cache”,“wordpress-SEO”).惯例是他们的目录和插件.PHP文件是相同的名称:
$wordpress_path = "/path/to/my/wordpress/install"; require_once( $wordpress_path . "/wp-load.PHP" ); //not sure if this line is needed //activate_plugin() is here: require_once( $wordpress_path . "/wp-admin/includes/plugin.PHP"); $plugins = array("cforms","w3-total-cache","wordpress-SEO"); foreach ($plugins as $plugin){ $plugin_path = $wordpress_path."wp-content/plugins/{$plugin}.PHP"; activate_plugin($plugin_path); }
以上是脚本宝典为你收集整理的php – 以编程方式安装和激活WordPress插件全部内容,希望文章能够帮你解决php – 以编程方式安装和激活WordPress插件所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。