WordPress.org

Make WordPress Core

Ticket #11059: 11059_patch_2.diff

File 11059_patch_2.diff, 764 bytes (added by strider72, 4 years ago)

Error is no longer dependent on WP functions

  • wp-config-sample.php

     
    6969/* That's all, stop editing! Happy blogging. */ 
    7070 
    7171/** WordPress absolute path to the Wordpress directory. */ 
    72 if ( !defined('ABSPATH') ) 
     72if ( ! defined( 'ABSPATH' ) ) { 
     73        if ( defined( 'WP_DEBUG' ) && ( true === WP_DEBUG ) ) 
     74            trigger_error( 'Calling wp-config.php directly from a plugin is <strong>strongly discouraged</strong>.  Instead your code should use actions and filters, or call "wp-blog-header.php"' ); 
    7375        define('ABSPATH', dirname(__FILE__) . '/'); 
     76} 
    7477 
    7578/** Sets up WordPress vars and included files. */ 
    7679require_once(ABSPATH . 'wp-settings.php');