You appear to be a bot. Output may be restricted
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