mirror of
https://github.com/WenPai-org/wp-china-yes.git
synced 2025-08-08 06:56:08 +08:00
feat:在插件列表中增加设置项
This commit is contained in:
parent
0b0df32670
commit
ca6ef7730c
1 changed files with 14 additions and 0 deletions
|
@ -18,6 +18,20 @@ if (is_admin()) {
|
||||||
require __DIR__ . '/setting.php';
|
require __DIR__ . '/setting.php';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插件列表项目中增加设置项
|
||||||
|
*/
|
||||||
|
add_filter('plugin_action_links', function ($links, $file) {
|
||||||
|
if ($file != plugin_basename(__FILE__)) {
|
||||||
|
return $links;
|
||||||
|
}
|
||||||
|
$settings_link = '<a href="' . menu_page_url('wp_china_yes', false) . '">设置</a>';
|
||||||
|
array_unshift($links, $settings_link);
|
||||||
|
|
||||||
|
return $links;
|
||||||
|
}, 10, 2);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化设置项
|
* 初始化设置项
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue