Ist es möglich, mehr als einen Autor für ein WordPress-Plugin zu verwenden, indem Sie den Kommentarblock des Plugins verwenden? Ich habe danach gesucht, aber ich denke, das ist nicht möglich. Gibt es einen Workaround dafür?
/** * 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, eg: 1.0 * Author: Name Of The Plugin Author * Author URI: http://URI_Of_The_Plugin_Author * License: A "Slug" license name eg GPL2 */
Probieren Sie es aus
1) Fügen Sie zuerst neue Header für das Plugin meta hinzu:
add_filter('extra_plugin_headers', 'add_extra_headers'); function add_extra_headers(){ return array('Author2'); }
2) Als nächstes filtern Sie die Metazeile des Autors für die Ausgabe:
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) Wenn Sie das Plugin erstellen, fügen Sie den neuen Metaschlüssel und Wert hinzu. Beispiel:
/** * Plugin Name: My Plugin * Plugin URI:http://myplugin.com * Description: My Plugin is the Best! * Version: 1.0 * Author: Author One Name * Author2: Author Two Name */