WordPress.org

Make WordPress Core

Ticket #29688: 29688.2.diff

File 29688.2.diff, 3.2 KB (added by diddledan, 3 years ago)

per slack discussion - docs change in sample config file and two additional _doing_it_wrong() calls

  • wp-config-sample.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    7979 */
    8080define('WP_DEBUG', false);
    8181
    82 /* That's all, stop editing! Happy blogging. */
     82/*
     83 * That's all, stop editing! Happy blogging.
     84 *
     85 * NOTHING PLACED BELOW THIS LINE WILL HAVE AN EFFECT ON YOUR SITE.
     86 *
     87 */
    8388
    8489/** Absolute path to the WordPress directory. */
    8590if ( !defined('ABSPATH') )
  • wp-load.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    2323
    2424error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
    2525
     26$_wp_config_file = '';
    2627/*
    2728 * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
    2829 * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
     
    3334 */
    3435if ( file_exists( ABSPATH . 'wp-config.php') ) {
    3536
    36         /** The config file resides in ABSPATH */
    37         require_once( ABSPATH . 'wp-config.php' );
     37    /** The config file resides in ABSPATH */
     38    $_wp_config_file = ABSPATH . 'wp-config.php';
    3839
    3940} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
    4041
    41         /** The config file resides one level above ABSPATH but is not part of another install */
    42         require_once( dirname( ABSPATH ) . '/wp-config.php' );
     42    /** The config file resides one level above ABSPATH but is not part of another install */
     43    $_wp_config_file = dirname( ABSPATH ) . '/wp-config.php';
     44
     45}
     46
     47if ( '' !== $_wp_config_file ) {
     48
     49    require_once( $_wp_config_file );
     50
     51    /**
     52     * Prove we're loaded correctly.
     53     */
     54    if ( ! isset( $wp_did_header ) ) {
     55        require_once( ABSPATH . WPINC . '/functions.php' );
     56        _doing_it_wrong( 'wp-load.php', __( 'Do not load wp-load.php directly.' ) ); // @todo: insert WordPress version number
     57    }
    4358
    4459} else {
    4560
  • wp-settings.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    102102require( ABSPATH . WPINC . '/pomo/mo.php' );
    103103require( ABSPATH . WPINC . '/class-phpass.php' );
    104104
     105/**
     106 * Prove we're loaded correctly. Executed soon-after functions.php is loaded, which is the earliest we can run _doing_it_wrong().
     107 */
     108if ( ! isset( $wp_did_header ) ) {
     109    _doing_it_wrong( 'wp-settings.php', __( 'Do not load wp-settings.php or wp-config.php directly.' ) ); // @todo: insert WordPress version number
     110}
     111
    105112// Include the wpdb class and, if present, a db.php database drop-in.
    106113global $wpdb;
    107114require_wp_db();