[wp-trac] Re: [WordPress Trac] #6341: feature request: plugin_baseurl() function

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 13 00:40:12 GMT 2008


#6341: feature request: plugin_baseurl() function
-------------------------------------+--------------------------------------
 Reporter:  Denis-de-Bernardy        |        Owner:  jacobsantos
     Type:  enhancement              |       Status:  assigned   
 Priority:  low                      |    Milestone:  2.7        
Component:  Optimization             |      Version:  2.5        
 Severity:  minor                    |   Resolution:             
 Keywords:  has-patch needs-testing  |  
-------------------------------------+--------------------------------------
Comment (by DD32):

 Keep in mind that [http://trac.wordpress.org/browser/trunk/wp-includes
 /link-template.php#L1041 plugins_url()] exists.

 It creates a URL based on {{{$url = plugins_url('my-plugin-
 folder/style.css');}}}

 Maybe instead, that function should be extended as such:
 {{{
 $url = plugins_url('style.css', __FILE__);
 function plugins_url($file = '', $relative = '') {
 if ( ! empty($relative) )
     $url .= dirname(plugin_basename($relative))
 $url .= $file;
 }
 }}}

 You get the idea..? In other words, have a 2nd param to have the URL
 created for hte plugins directory, but relative to the current plugins
 folder.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6341#comment:7>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list