Sorry, the changes made were to this function.
I also wanted to skip a plugin, so added that bit,
but the main thing was being able to offer a Short Description.
My little hack works fine, but it was not immediately obvious
how I could add the maximum length to the shortcode,
like max_desc=140 rather than having it hard coded.
<code>
function replace_plugin_list_tags( $plugin_data, $format, $nofollow, $target ) {
// SKIP PLUGIN BY NAME
if ($plugin_data['Title'] == "Plugin Name") { unset($format); }
// CREATE SHORT DESCRIPTION (truncate at first period or 140 characters)
$pre_desc = explode('.', $plugin_data['Description']);
$sho_desc = $pre_desc[0];
$pos=strpos($sho_desc, ' ', 140);
$sho_desc = (strlen($sho_desc) > 140) ? substr($sho_desc,0,$pos).'...' : $sho_desc.'.';
$format = strtr(
$format,
array(
'{{Title}}' => $plugin_data['Title'],
'{{PluginURI}}' => $plugin_data['PluginURI'],
'{{AuthorURI}}' => $plugin_data['AuthorURI'],
'{{Version}}' => $plugin_data['Version'],
'{{Description}}' => $plugin_data['Description'],
'{{ShortDesc}}' => $sho_desc,
'{{Author}}' => $plugin_data['Author'],
'{{LinkedTitle}}' => "<a href='" . $plugin_data['PluginURI'] . "' title='" . $plugin_data['Title'] . "'" . $nofollow . $target . '>' . $plugin_data['Title'] . '</a>',
'{{LinkedAuthor}}' => "<a href='" . $plugin_data['AuthorURI'] . "' title='" . $plugin_data['Author'] . "'" . $nofollow . $target . '>' . $plugin_data['Author'] . '</a>',
'#Title#' => $plugin_data['Title'],
'#PluginURI#' => $plugin_data['PluginURI'],
'#AuthorURI#' => $plugin_data['AuthorURI'],
'#Version#' => $plugin_data['Version'],
'#Description#' => $plugin_data['Description'],
'#Author#' => $plugin_data['Author'],
'#LinkedTitle#' => "<a href='" . $plugin_data['PluginURI'] . "' title='" . $plugin_data['Title'] . "'" . $nofollow . $target . '>' . $plugin_data['Title'] . '</a>',
'#LinkedAuthor#' => "<a href='" . $plugin_data['AuthorURI'] . "' title='" . $plugin_data['Author'] . "'" . $nofollow . $target . '>' . $plugin_data['Author'] . '</a>',
'{{' => '<',
'}}' => '>',
'{' => '<',
'}' => '>',
)
);
return $format;
}
</code>
-
This reply was modified 2 years, 2 months ago by
DigTek.