Wordpress,在“插件"页面中为所有插件添加一个选项 [英] Wordpress, add an option for all plugins in plugins page
问题描述
在/wp-admin/plugins.php中,我想在编辑",激活",设置"之后添加一个选项,但是我想为所有插件建立链接,而不仅仅是当前插件.也许在每个问题之后都报告问题",然后执行一些操作.我正在考虑使用jQuery在Wordpress之外进行此操作,但我想知道是否有人可以想到另一种方法来做到这一点.我可以追上钩吗?
In /wp-admin/plugins.php, I want to add an option after the "Edit" "Activate" "Settings", but I want to make a link for all plugins, not just the current one. Maybe "Report a Problem" after each one, which then does something. I'm thinking of using jQuery to do this outside of Wordpress, but I was wondering if anyone can think of another way to do it. Is there a hook I could go after?
推荐答案
函数custom_menu() { add_menu_page(__('HELLO HERE','custom_menu'),__('HELLO HERE','custom_menu'),'activate_plugins','HELLO HERE','custom_menu_example'); }
function custom_menu() { add_menu_page(__('HELLO HERE', 'custom_menu'), __('HELLO HERE', 'custom_menu'), 'activate_plugins', 'HELLO HERE', 'custom_menu_example'); }
add_action('admin_menu','custom_menu');
add_action('admin_menu', 'custom_menu');
在主题下创建新文件夹(例如"morning").在该文件夹内创建新文件,例如XYZ.php.将上面的代码粘贴到该文件中.
create new folder (say 'morning') under your theme.inside that folder create new file for example XYZ.php. paste above code in that file.
现在要包含该文件,请转到您主题的functions.php,并在代码下方的文件开头定义
Now to include that file, go to functions.php of your theme and define at begining of file below code
require_once('mornign/XYZ.php');
require_once( 'mornign/XYZ.php' );
我希望它将对您有帮助
这篇关于Wordpress,在“插件"页面中为所有插件添加一个选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!