Skip to content

Commit

Permalink
Add deprecation notices for deprecated config parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Jul 15, 2015
1 parent 84890d5 commit fe515a4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions class-tgm-plugin-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
Expand Down

0 comments on commit fe515a4

Please sign in to comment.