Changeset 10578 for trunk/wp-includes/link-template.php
- Timestamp:
- 02/15/2009 04:50:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r10554 r10578 1505 1505 1506 1506 /** 1507 * Retrieve the url to the plugins directory. 1507 * Retrieve the url to the plugins directory or to a specific file within that directory. 1508 * You can hardcode the plugin slug in $path or pass __FILE__ as a second argument to get the correct folder name. 1508 1509 * 1509 1510 * @package WordPress … … 1511 1512 * 1512 1513 * @param string $path Optional. Path relative to the plugins url. 1514 * @param string $plugin Optional. The plugin file that you want to be relative to - i.e. pass in __FILE__ 1513 1515 * @return string Plugins url link with optional path appended. 1514 1516 */ 1515 function plugins_url($path = '' ) {1517 function plugins_url($path = '', $plugin = '') { 1516 1518 $scheme = ( is_ssl() ? 'https' : 'http' ); 1517 1519 $url = WP_PLUGIN_URL; … … 1521 1523 } 1522 1524 1525 if ( !empty($plugin) && is_string($plugin) ) 1526 { 1527 $folder = dirname(plugin_basename($plugin)); 1528 if ('.' != $folder) 1529 $url .= '/' . ltrim($folder, '/'); 1530 } 1531 1523 1532 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 1524 1533 $url .= '/' . ltrim($path, '/');
Note: See TracChangeset
for help on using the changeset viewer.