« first day (1785 days earlier)      last day (3159 days later) » 

11:05 AM
Is there any reason to use plugin_dir_path( __FILE__ ) over __DIR__ or dirname( __FILE__ ) when including files in plugins?
 
 
2 hours later…
12:38 PM
@shea You can mock the function in a test. Besides that, no.
 
I just looked at the code of the function and now I feel stupid for asking :/
Huh, I didn't know that you could just do dirname( __FILE__, 3 ) instead of going dirname( dirname( dirname( __FILE__ ) ) )
 
> 7.0.0 Added the optional levels parameter.
 
Ah. That would explain why I've never seen it used before
 
One of those improvements that make you think: why wasn't it like this from the beginning?
 
1:18 PM
Yeah, exactly. But since I'm still not even using 5.3 namespaces on most of my projects, it'll be a while before I can use this feature
 

« first day (1785 days earlier)      last day (3159 days later) »