Created
December 23, 2017 17:29
-
-
Save cemaleker/fcfd7822152bcb15a809e4b31d6d0264 to your computer and use it in GitHub Desktop.
Fixes symlink resolution on redux options of embedded redux framework in neighborhood wordpress theme.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function __rd_dirname($path) { | |
$path = dirname($path); | |
return __rd_resolve_real($path); | |
} | |
function __rd_resolve_real($path) { | |
return realpath(is_link($path) ? readlink($path) : $path); | |
} | |
// Windows-proof constants: replace backward by forward slashes - thanks to: https://github.com/peterbouwmeester | |
$_dir = trailingslashit( str_replace( '\\', '/', __rd_dirname( __FILE__ ) ) ); | |
$wp_content_dir = trailingslashit( str_replace( '\\', '/', __rd_resolve_real(WP_CONTENT_DIR) ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment