mirror of
https://github.com/WenPai-org/wp-china-yes.git
synced 2025-08-03 11:11:30 +08:00
29 lines
668 B
PHP
29 lines
668 B
PHP
<?php
|
|
|
|
namespace WenPai\ChinaYes\Service;
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
/**
|
|
* Class Base
|
|
* 插件主服务
|
|
* @package WenPai\ChinaYes\Service
|
|
*/
|
|
class Base {
|
|
|
|
public function __construct() {
|
|
/**
|
|
* 插件列表页中所有插件增加「参与翻译」链接
|
|
*/
|
|
add_filter( sprintf( '%splugin_action_links', is_multisite() ? 'network_admin_' : '' ), function ( $links, $plugin = '' ) {
|
|
$links[] = '<a target="_blank" href="https://translate.wenpai.org/projects/plugins/' . substr( $plugin, 0, strpos( $plugin, '/' ) ) . '/">参与翻译</a>';
|
|
|
|
return $links;
|
|
}, 10, 2 );
|
|
|
|
// 加速服务
|
|
new Super();
|
|
// 更新服务
|
|
new Update();
|
|
}
|
|
}
|