Enhancement : Improve reliability of path constants
-
Hi,
I’ve recently started using Polylang (I was previously a WPML aficionado). Doing a lot of in-depth development with it. Loving it a lot, very clean.
Anyway, I initially had Polylang in the
plugins/
directory and have now moved it to themu-plugins/
directory to be able to access it earlier in relation to another plugins—such as Advanced Custom Fields that is also a must-use plugin.Now: I’ve stumbled upon an issue with
POLYLANG_URL
, since no second parameter is provided forplugins_url()
, WordPress can’t properly locate it and decides to apply the plugins URL instead of the mu-plugins URL. This can be solved usingplugin_dir_url()
.Here’s a more complete set of suggestions for improved paths :
define( 'POLYLANG_DIR', plugin_dir_path( __FILE__ ) )
define( 'POLYLANG_URL', plugin_dir_url( __FILE__ ) )
Cheers!
- The topic ‘Enhancement : Improve reliability of path constants’ is closed to new replies.