
ITI
User
May 24, 2011, 6:40 PM
Post #1 of 5
(1096 views)
Shortcut
|
|
Plugin Descriptions on mutiple lines
|
Can't Post
|
|
I've been working on some plugins lately, including some plugin documentation that I'm sure others will be interested in when I'm done. Anyway, one annoying thing is that the plugin description can only be entered on one line which results in a half mile of horizontal scrolling. Would you please consider this minor modification to: function getPluginData().
function getPluginData($filename) { ... // get plugin data $pluginData = array(); $fileContent = file_get_contents($filepath); foreach ($textKeyToFieldname as $textKey => $fieldname) { if($textKey == 'Description'){ preg_match_all("/$textKey:(.*?)(\r|\n)/mi", $fileContent, $matches); // match \r as well for mac users who uploaded file in ascii with wrong line end chars (and windows users who would be \r\n) for($i=0;$i<count($matches[1]);$i+=1){ if(isset($pluginData[$fieldname])) $pluginData[$fieldname] .= ($matches[1][$i]); else $pluginData[$fieldname] = ($matches[1][$i]); } }else { preg_match("/$textKey:(.*?)(\r|\n)/mi", $fileContent, $matches); // match \r as well for mac users who uploaded file in ascii with wrong line end chars (and windows users who would be \r\n) $pluginData[$fieldname] = trim( @$matches[1] ); } } ... } A description could then be written over multiple lines like this:
<?php /** * Plugin Name: PI Name * Description: My very long description ...... * Description: that goes on and on and on * Description: but I don't have to scroll to read it. * Description: Wouldn't this be nice. * Version: 1.0 beta * Requires at least: 2.00 */ Thanks for looking at it. Glen Glen http://www.CanadianDomainRegistry.ca ITI Internetworking Technologies Inc.
|