在 WordPress 插件中使用标题

问题描述 投票:0回答:2

wordpress插件具有以下格式

<?php
/*
 * Plugin Name: XYZ
 * Plugin URI: # 
 * Description: It is used to ..
 * Version: 1.1
 * License:  GPLv2 (or later)  
 */

但是许可证文本不会出现在管理端的安装列表中。

例如 Akismet - 这是格式

Version 2.5.9 | By Automattic | Visit plugin site 

输入的许可证文本不显示。如何使用 WordPress 格式显示许可证文本。

提前致谢

php wordpress
2个回答
1
投票

Wordpress 不会在任何地方显示许可证文本。 请参阅:plugin.php


0
投票

您可以

use plugin_row_meta
过滤以在插件列表中添加额外的行。详情请参阅以下代码:

function set_plugin_meta($links, $file) {
    $plugin = plugin_basename(__FILE__);
    // create link
    if ($file == $plugin) {
        return array_merge(
        $links,
        array( sprintf( '<a href="https://www.google.com">Your License type</a>', $plugin, __('myplugin') ) )
        );
    }
    return $links;
}
add_filter( 'plugin_row_meta', 'set_plugin_meta', 10, 2 );
© www.soinside.com 2019 - 2024. All rights reserved.