wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_register_plugin_realpath › WordPress Function
Seit3.9.0
Veraltetn/v
› wp_register_plugin_realpath ( $file )
| Parameter: |
|
| Siehe: | |
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: |
Register a plugin's real path.
This is used in plugin_basename() to resolve symlinked paths.Ähnliche Funktionen: wp_register_script, wp_register_position_support, wp_register_ability, wp_deregister_script, wp_targeted_link_rel
Quellcode
function wp_register_plugin_realpath( $file ) {
global $wp_plugin_paths;
// Normalize, but store as static to avoid recalculation of a constant value.
static $wp_plugin_path = null, $wpmu_plugin_path = null;
if ( ! isset( $wp_plugin_path ) ) {
$wp_plugin_path = wp_normalize_path( WP_PLUGIN_DIR );
$wpmu_plugin_path = wp_normalize_path( WPMU_PLUGIN_DIR );
}
$plugin_path = wp_normalize_path( dirname( $file ) );
$plugin_realpath = wp_normalize_path( dirname( realpath( $file ) ) );
if ( $plugin_path === $wp_plugin_path || $plugin_path === $wpmu_plugin_path ) {
return false;
}
if ( $plugin_path !== $plugin_realpath ) {
$wp_plugin_paths[ $plugin_path ] = $plugin_realpath;
}
return true;
}