Description
Create a link to the plugin's download pageThe link to the download page is determined from a number of fields in the plugininfo structure which get set as we're trying to find out about the plugin. oik_server plugin_server link to set ———- ————- ————————- null "unknown" $homepage – since this is neither a wordpress.org or "oik" plugin null not set wordpress.org/plugins/$name set n/a oik_server
Usage
$string = bw_link_plugin_download( $name, $plugininfo );Parameters
- $name
- ( string ) required – the plugin slug name e.g. oik, jetpack, woocommerce
- $plugininfo
- ( mixed ) required – some form of SimpleXMLElement Object
Returns
string the download page URL… which may have a trailing slashSource
File name: oik-bob-bing-wide/shortcodes/oik-plug.phpLines:
1 to 16 of 16
function bw_link_plugin_download( $name, $plugininfo ) { $title = "Link to the $plugininfo->name ($name: $plugininfo->short_description) plugin" ; $download_page = bw_array_get( $plugininfo, "oik_server", null ); if ( !$download_page ) { $plugin_server = bw_array_get( $plugininfo, "plugin_server", null ); if ( $plugin_server == "unknown" ) { $download_page = bw_array_get( $plugininfo, "homepage", null ); } else { $download_page = "https://wordpress.org/plugins/".$name; } } else { $download_page = bw_array_get( $plugininfo, "homepage", $download_page ); } alink( "plugin", $download_page , $plugininfo->slug, $title ); return( $download_page ); }View on GitHub
Called by
1 to 2 of 2
Invoked by
Call hooks
API Letters:
