From fe515a4e61c4011d3bba49046cdc1d4011cdcec9 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 16 Jul 2015 00:54:54 +0200 Subject: [PATCH] Add deprecation notices for deprecated config parameters. --- class-tgm-plugin-activation.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/class-tgm-plugin-activation.php b/class-tgm-plugin-activation.php index ca0464be..ee6eb730 100755 --- a/class-tgm-plugin-activation.php +++ b/class-tgm-plugin-activation.php @@ -1932,6 +1932,21 @@ function tgmpa( $plugins, $config = array() ) { } if ( ! empty( $config ) && is_array( $config ) ) { + // Send out notices for deprecated arguments passed. + if ( isset( $config['notices'] ) ) { + _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' ); + if ( ! isset( $config['has_notices'] ) ) { + $config['has_notices'] = $config['notices']; + } + } + + if ( isset( $config['parent_menu_slug'] ) ) { + _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); + } + if ( isset( $config['parent_url_slug'] ) ) { + _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); + } + call_user_func( array( $instance, 'config' ), $config ); } }