• I found an error in the use of detecting the plugin directory and I thought this might be of use to those who have done the same as me.

    I have customised how my WordPress files are located from the usual ‘wp-content’ directory and I have also moved my plugins folder out of that by defining WP_PLUGIN_DIR in my wp-config.php file.

    When setting up the plugin I was given an error that told me that certain files could not be read due to the location of where it was trying to load the files from.

    So after a little reading into the code of this plugin I found that one line needed to be changed.

    Before:
    define('WP_EMAIL_TEMPLATE_DIR', WP_CONTENT_DIR . '/plugins/' . WP_EMAIL_TEMPLATE_FOLDER);

    After:
    define('WP_EMAIL_TEMPLATE_DIR', WP_PLUGIN_DIR . '/' . WP_EMAIL_TEMPLATE_FOLDER);

    After that, the plugin no longer displayed the error and the site was operational again.

    Hope this helps anyone else who have had a similar issue.

    https://ww.wp.xz.cn/plugins/wp-email-template/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Steve Truman

    (@a3rev)

    Hello Sebastien

    Thank you for your post – support for that has been added in the latest version1.2.1

    * Tweak – Changed WP_CONTENT_DIR to WP_PLUGIN_DIR. When an admin sets a custom WordPress file structure then it can get the correct path of plugin

    Steve

    Thread Starter Sébastien Dumont

    (@sebd86)

    That’s great to hear Steve. I’m glad I could help out.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Define the Plugin Directory correctly’ is closed to new replies.