admin管理员组文章数量:1022752
I'm learning how to develop WP plugins.
I would like to try calling some methods to see what they return. It would be great if I could do so in the console instead of writing tests or log messages.
Is there such a thing as a Wordpress console? That is, I'd like to log in to WP in the terminal and call methods directly.
I'm learning how to develop WP plugins.
I would like to try calling some methods to see what they return. It would be great if I could do so in the console instead of writing tests or log messages.
Is there such a thing as a Wordpress console? That is, I'd like to log in to WP in the terminal and call methods directly.
Share Improve this question asked May 16, 2019 at 21:28 user3574603user3574603 3411 gold badge2 silver badges11 bronze badges 2 |1 Answer
Reset to default -1If you want to see notices/messages in the admin area, try 'Admin Notices' . See https://codex.wordpress/Plugin_API/Action_Reference/admin_notices .
A good tutorial is here: https://www.wpbeginner/wp-tutorials/how-to-add-admin-notices-in-wordpress/.
I recommend setting the 'is_dismissable' class in the HTML of the message you want to display. That will allow you to close/exit the notice.
I'm learning how to develop WP plugins.
I would like to try calling some methods to see what they return. It would be great if I could do so in the console instead of writing tests or log messages.
Is there such a thing as a Wordpress console? That is, I'd like to log in to WP in the terminal and call methods directly.
I'm learning how to develop WP plugins.
I would like to try calling some methods to see what they return. It would be great if I could do so in the console instead of writing tests or log messages.
Is there such a thing as a Wordpress console? That is, I'd like to log in to WP in the terminal and call methods directly.
Share Improve this question asked May 16, 2019 at 21:28 user3574603user3574603 3411 gold badge2 silver badges11 bronze badges 2- 1 There's the WP-CLI but this won't allow you to access plugin functions unless the plugin is setup to work with the CLI. – Alexander Holsgrove Commented May 16, 2019 at 21:30
-
Thanks. I see the CLI provides
wp shell
which is what I need. – user3574603 Commented May 16, 2019 at 21:44
1 Answer
Reset to default -1If you want to see notices/messages in the admin area, try 'Admin Notices' . See https://codex.wordpress/Plugin_API/Action_Reference/admin_notices .
A good tutorial is here: https://www.wpbeginner/wp-tutorials/how-to-add-admin-notices-in-wordpress/.
I recommend setting the 'is_dismissable' class in the HTML of the message you want to display. That will allow you to close/exit the notice.
本文标签: plugin developmentIs there such a thing as a WordPress console
版权声明:本文标题:plugin development - Is there such a thing as a WordPress console? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745486486a2152767.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
wp shell
which is what I need. – user3574603 Commented May 16, 2019 at 21:44