WordPress get plugin directory

Yeah as per description of plugin_dir_path it will give you current plugin file path. But as per what you asking here you can do something like below unfortunately no direct way,

$plugin_dir = ABSPATH . 'wp-content/plugins/plugin-folder/';

Edit: 18-09-2021

The best practice is to use with latest version is WP_PLUGIN_DIR as follow:

$plugin_dir = WP_PLUGIN_DIR . '/plugin-folder';

Leave a Comment