最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp cli - How do I activate an mu-plugin with WP-CLI?

programmeradmin4浏览0评论

Do I need some extra WP-CLI bundle to activate mu-plugins via command line? I can't find anything about that in the docs. Are mu-plugins treated differently by WP-CLI?

I created /wp-content/mu-plugins/my-plugin.php containing:

<?php
/*
  Plugin Name: My Plugin
  Description: Provide must-use code.
  Version: 1.0
*/

When I do:

$ wp plugin list

I get:

+---------------+----------+--------+---------+
| name          | status   | update | version |
+---------------+----------+--------+---------+
| akismet       | inactive | none   | 4.0.8   |
| hello         | active   | none   | 1.7     |
| my-plugin     | must-use | none   | 1.0     |
+---------------+----------+--------+---------+

But when I do:

$ wp plugin activate my-plugin

I get:

Warning: The 'my-plugin' plugin could not be found.
Error: No plugins activated.

Do I need some extra WP-CLI bundle to activate mu-plugins via command line? I can't find anything about that in the docs. Are mu-plugins treated differently by WP-CLI?

I created /wp-content/mu-plugins/my-plugin.php containing:

<?php
/*
  Plugin Name: My Plugin
  Description: Provide must-use code.
  Version: 1.0
*/

When I do:

$ wp plugin list

I get:

+---------------+----------+--------+---------+
| name          | status   | update | version |
+---------------+----------+--------+---------+
| akismet       | inactive | none   | 4.0.8   |
| hello         | active   | none   | 1.7     |
| my-plugin     | must-use | none   | 1.0     |
+---------------+----------+--------+---------+

But when I do:

$ wp plugin activate my-plugin

I get:

Warning: The 'my-plugin' plugin could not be found.
Error: No plugins activated.
Share Improve this question edited Aug 27, 2020 at 14:22 norman.lol asked Sep 6, 2018 at 13:18 norman.lolnorman.lol 3,2313 gold badges29 silver badges35 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 6

mu-plugins don’t get activated. They’re activated just by being in that folder.

发布评论

评论列表(0)

  1. 暂无评论