WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Enable Media Replace] Bug and suggested resolution: (5 posts)

  1. Kruncher
    Member
    Posted 4 years ago #

    When attempting to upload an image there is an error with the include. May I suggest the following fix which worked for me?

    require_once("../../../wp-load.php");
    require_once("../../../wp-admin/admin.php");

    http://wordpress.org/extend/plugins/enable-media-replace/

  2. Måns Jonasson
    Member
    Posted 3 years ago #

    Your solution makes assumptions about the location of WordPress folders and is therefore not recommended.

    What is the error you are getting with your include?

    /M;

  3. Milan Dinić
    Member
    Posted 3 years ago #

    Kruncher makes assumptions about the location of WordPress folders but so di you in upload.php. You should have different approach since wp-content directory can have a different name.

    Also, instead of get_bloginfo("wpurl") . "/wp-admin/upload.php you should use admin_url( 'upload.php' ) (same applies to other link to /wp-admin pages).

    Oh, and some gettext functions miss textdomain.

  4. Måns Jonasson
    Member
    Posted 3 years ago #

    Thanks for the heads up. I will take another look at the locations in my next revision, and also look over the gettext functions.

  5. Måns Jonasson
    Member
    Posted 3 years ago #

    I just committed version 2.4 which fixes this issue. Try it out!

Topic Closed

This topic has been closed to new replies.

About this Topic