3

Is it possible to have more than one author for a WordPress plugin using the plugin comment block? I searched for it, but I think it's not possible through the default way. Is there a workaround for this?

/**
 * Plugin Name: Name Of The Plugin
 * Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
 * Description: A brief description of the Plugin.
 * Version: The Plugin's Version Number, e.g.: 1.0
 * Author: Name Of The Plugin Author
 * Author URI: http://URI_Of_The_Plugin_Author
 * License: A "Slug" license name e.g. GPL2
 */
  • 1
    A quick look at the code, I think you may have some luck by using the filter 'plugin_row_meta'. Used in: /wp-admin/includes/class-wp-plugins-list-table.php at line 552 – Seamus Leahy Oct 1 '14 at 14:31
  • 1
    You can add a lot of authors, but only one author URI and I think, that is your problem? If you will solve this topic then is this possible via a filter, like plugin_row_meta. – bueltge Oct 1 '14 at 14:32
  • Thanks for the reply guys, I will try to play with this filter and update the question with my best result. – MacLover Oct 1 '14 at 15:27
1

Give this a try

1) First add new headers for the plugin meta:

add_filter('extra_plugin_headers', 'add_extra_headers');

function add_extra_headers(){
return array('Author2');
}

2) Next filter the authors meta row on output:

add_filter('plugin_row_meta', 'filter_authors_row_meta', 1, 4);

function filter_authors_row_meta($plugin_meta, $plugin_file, $plugin_data, $status ){

if(empty($plugin_data['Author'])){
    return $plugin_meta;
}


if ( !empty( $plugin_data['Author2'] ) ) {
    $plugin_meta[1] = $plugin_meta[1] . ', ' . $plugin_data['Author2'];
}


return $plugin_meta;
}

3) When you create the plugin add the new meta key and value..example:

/**
 * Plugin Name: My Plugin
 * Plugin URI:http://myplugin.com
 * Description: My Plugin is the Best!
 * Version: 1.0
 * Author: <a href="#">Author One Name</a>
 * Author2: <a href="#">Author Two Name</a>
 */
0

David's solution didn't work for me, but I was able to do part of what he did and put links directly in the author field.

    Author: <a href="#1">Author 1</a>, <a href="#2">Author 2</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.