• Resolved fsevenflatfive

    (@fsevenflatfive)


    Hello,

    We use a custom structure for our wordpress ( based on bedrock ), and there is an issue with loading the wp-load.php file, since we don’t have a wp-content folder.

    The problem comes from /utils/ajax/wpdiscuz-ajax.php line 162

    function wpdiscuz_ABSPATH() {
        $path = join(DIRECTORY_SEPARATOR, ["wp-content", "plugins", "wpdiscuz", "utils", "ajax"]);
        return str_replace($path, "", __DIR__);
    }

    A simple fix would be to allow users to override this constant, like this for example :

    function wpdiscuz_ABSPATH() {
        $env = getenv('WPDISCUZ_ABSPATH');
    
        if($env) {
            return $env;
        }
    
        $path = join(DIRECTORY_SEPARATOR, ["wp-content", "plugins", "wpdiscuz", "utils", "ajax"]);
        return str_replace($path, "", __DIR__);
    }

    It would allow modern WordPress stack to work along with wpdiscuz ajax functions.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Erreur with wpdiscuz-ajax’ is closed to new replies.