From ee18e04df01dc9210e6a0f75748d6748eb9dfb1a Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Wed, 18 Nov 2015 20:48:24 +0000 Subject: [PATCH] Revert [34291] bringing back my-hacks Keeping myhacks support is a small price to pay for not breaking people's sites. Even if it is very very very few sites, breaking sites isn't something that should be encouraged. Even with 10 years of deprecation notices. https://core.trac.wordpress.org/ticket/33741#comment:18 outlines all the ways that the hack_file and my-hacks options can be setup and thus all the ways that the removal of those options could break sites. Fixes #33741. git-svn-id: https://develop.svn.wordpress.org/trunk@35688 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/file.php | 1 + src/wp-admin/includes/schema.php | 1 + src/wp-includes/load.php | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index ce7acf73bb..d588e15e6c 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -39,6 +39,7 @@ $wp_file_descriptions = array( 'video.php' => __('Video Attachment Template'), 'audio.php' => __('Audio Attachment Template'), 'application.php' => __('Application Attachment Template'), + 'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ), '.htaccess' => __( '.htaccess (for rewrite rules )' ), // Deprecated files 'wp-layout.css' => __( 'Stylesheet' ), diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php index d494e5dd99..05e82cee21 100644 --- a/src/wp-admin/includes/schema.php +++ b/src/wp-admin/includes/schema.php @@ -420,6 +420,7 @@ function populate_options() { 'comment_moderation' => 0, 'moderation_notify' => 1, 'permalink_structure' => '', + 'hack_file' => 0, 'blog_charset' => 'UTF-8', 'moderation_keys' => '', 'active_plugins' => array(), diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 1275acad37..9d247baa90 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -552,6 +552,13 @@ function wp_get_mu_plugins() { function wp_get_active_and_valid_plugins() { $plugins = array(); $active_plugins = (array) get_option( 'active_plugins', array() ); + + // Check for hacks file if the option is enabled + if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) { + _deprecated_file( 'my-hacks.php', '1.5' ); + array_unshift( $plugins, ABSPATH . 'my-hacks.php' ); + } + if ( empty( $active_plugins ) || wp_installing() ) return $plugins;