user3230561
user3230561

Reputation: 445

Using headers in wordpress plugin

The wordpress plugin has the following format

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

But the text for license does not appear in the admin side's installed list.

for e.g for Akismet - this is the format

Version 2.5.9 | By Automattic | Visit plugin site 

The text entered for license does not show up. How can I display the text for license using the wordpress format.

Thanks in Advance

Upvotes: 2

Views: 81

Answers (2)

Manesh Timilsina
Manesh Timilsina

Reputation: 719

You can use plugin_row_meta filter to add extra row in your plugin listing. See code below for detail:

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 );

Upvotes: 0

mukki182
mukki182

Reputation: 135

Wordpress ist not showing the license text anywhere. See: plugin.php

Upvotes: 1

Related Questions