Description
Return the path of the oik base plugin or any particular fileNote: You can either use oik_path() to find where oik is installed OR use add_action( "init", "oik_init" ); to let oik initialise itself and then you don't have to worry about including the oik header files until you need them. Use add_action( "oik_loaded", 'your_init_function' ); to know when oik has been loaded so you can use the APIs. Note: oik_boot may be loaded before WordPress has done its stuff, so we may need to define some constants ourselves. Here we assume the file is in ABSPATH/wp-content/plugins/oik/libs so we need 4 dirnames to get back to ABSPATH, and then we need to convert backslashes to forward slashes and the drive letter, if present, to uppercase.
Usage
$string = oik_path( $file, $plugin );Parameters
- $file
- ( string ) optional – the relative file name within the plugin, without a leading slash
- $plugin
- ( string ) optional default: oik – the plugin slug
Returns
string the fully qualified plugin file nameSource
File name: oik/libs/oik_boot.phpLines:
function oik_path( $file=NULL, $plugin='oik') { $wp_plugin_dir = str_replace( "\\", '/', WP_PLUGIN_DIR ); return( $wp_plugin_dir . '/'. $plugin. '/' . $file ); }View on GitHub View on Trac
Called by
- bw_jquery_script_url() – Default jQuery script file filter
- bw_oik_lazy_add_shortcodes() – Implement "oik_add_shortcodes" action for oik
- oik_lib_set_lib_versions() –
- oik_require() – Invoke require_once on an oik include file or other file
- oik_require2() – Load a file which could have been relocated from one plugin to another
- Tests_oik_admin::remove_most_shortcodes() –
- Tests_shortcodes_oik_thumbs::dummy_attachment() –
