Skip to:
Content

BuddyPress.org

Changeset 11233


Ignore:
Timestamp:
11/04/2016 03:49:51 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Loader: Make sure deprecated code is ignored unless explicitly defined to be included.

Also deprecate the BP_IGNORE_DEPRECATED constant, since this is now an option. (We'll still obey it if it's set later.)

See: #7307, #7323, #7322. For trunk.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-options.php

    r11163 r11233  
    103103        /* Legacy *********************************************/
    104104
    105         // Whether to register the bp-default themes directory.
     105        // Do not register the bp-default themes directory.
    106106        '_bp_retain_bp_default'                => false,
    107107
    108         // Whether to load deprecated code.
     108        // Ignore deprecated code.
    109109        '_bp_ignore_deprecated_code'           => true,
    110110
  • trunk/src/bp-core/bp-core-update.php

    r11105 r11233  
    539539    }
    540540
    541     // Load deprecated code for existing installs.
     541    // Do not ignore deprecated code for existing installs.
    542542    bp_add_option( '_bp_ignore_deprecated_code', false );
    543543}
  • trunk/src/bp-loader.php

    r11228 r11233  
    307307        }
    308308
    309         // Whether to refrain from loading deprecated functions
    310         if ( ! defined( 'BP_IGNORE_DEPRECATED' ) ) {
    311             define( 'BP_IGNORE_DEPRECATED', true );
    312         }
    313 
    314309        // The search slug has to be defined nice and early because of the way
    315310        // search requests are loaded
     
    337332
    338333        /**
    339          * Whether to load deprecated code or not.
     334         * Should deprecated code be loaded?
    340335         *
    341          * @since 2.0.0
    342          * @since 2.7.0 Defaults to false (do not load deprecated code) for new installs.
    343          *
    344          * @const constant BP_IGNORE_DEPRECATED Whether or not to ignore deprecated functionality.
    345          */
    346         $this->load_deprecated = ! apply_filters( 'bp_ignore_deprecated', BP_IGNORE_DEPRECATED );
     336         * @since 2.0.0 Defaults to false always
     337         * @since 2.8.0 Defaults to true on upgrades, false for new installs.
     338         */
     339        $this->load_deprecated = ! bp_get_option( '_bp_ignore_deprecated_code', true );
    347340
    348341        /** Toolbar ***********************************************************/
     
    457450        if ( ! defined( 'BP_DB_VERSION' ) ) {
    458451            define( 'BP_DB_VERSION', $this->db_version );
     452        }
     453
     454        // Define if deprecated functions should be ignored
     455        if ( ! defined( 'BP_IGNORE_DEPRECATED' ) ) {
     456            define( 'BP_IGNORE_DEPRECATED', true );
    459457        }
    460458    }
     
    510508        }
    511509
    512         // Skip or load deprecated content
    513         if ( $this->load_deprecated || ! bp_get_option( '_bp_ignore_deprecated_code' ) ) {
     510        // Maybe load deprecated functionality
     511        if ( true === $this->load_deprecated ) {
    514512            require( $this->plugin_dir . 'bp-core/deprecated/1.2.php' );
    515513            require( $this->plugin_dir . 'bp-core/deprecated/1.5.php' );
Note: See TracChangeset for help on using the changeset viewer.