WordPress.org

Ready to get started?Download WordPress

Forums

Downloads Manager
Hardcoded file paths (3 posts)

  1. Ruben.cc
    Member
    Posted 3 years ago #

    This is yet another plugin that is failing because it has filepaths hardcoded in the PHP code rather then correctly reading the paths from the wp-config file. It's getting quite annoying by now since I've been trying to find a decent plugin for about an hour now!

    I have no "wp-content" folder, but just a "content" folder instead.
    I have no "plugins" folder within a "wp-content" or "content" folder, but just in the root.

    Why do developers insist on hardcoding these paths while these are all options that can be set in the wp-config file.

  2. nsathees
    Member
    Posted 3 years ago #

    how do you do that? I need to know!

  3. Ruben.cc
    Member
    Posted 3 years ago #

    define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/content');
    define( 'WP_CONTENT_URL', 'http://yoursite.url/content');
    define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/plugins');
    define( 'WP_PLUGIN_URL', 'http://yoursite.url/plugins');
    define( 'PLUGINDIR', '/plugins'); // support for older plugins

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic