WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #13550, comment 21


Ignore:
Timestamp:
03/23/11 20:31:12 (4 years ago)
Author:
scribu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13550, comment 21

    initial v1  
    77 
    88For plugin-provided downloadable files (such as JS or CSS), the best solution we have come up with so far is to do: 
    9    $url = plugins_url( basename(dirname(__ FILE __)).'/path/to/file'); 
     9 
     10{{{$url = plugins_url( basename(dirname(__ FILE __)).'/path/to/file');}}} 
    1011 
    1112which could be expressed as: 
    12    $url = WP_PLUGIN_URL.plugin_basename(dirname(__ FILE __).'/path/to/file' 
     13 
     14{{{$url = WP_PLUGIN_URL.plugin_basename(dirname(__ FILE __).'/path/to/file'}}} 
    1315 
    1416 
    15 This can an issue when __ FILE __'s path is not precisely WP_CONTENT_DIR .'/'. <plugin_basename> .'/'. <filename>, since plugin_basename is actually a symlink. 
    16  
     17This can an issue when {{{__FILE__}}}'s path is not precisely {{{WP_CONTENT_DIR .'/'. <plugin_basename> .'/'. <filename>}}}, since plugin_basename is actually a symlink. 
    1718 
    1819I'm available to provide more input on this.