Skip to content

Commit

Permalink
Merge pull request #389 from thomasgriffin/feature/deprecate-a-filter
Browse files Browse the repository at this point in the history
Deprecate the 'tgmpa_admin_menu_use_add_theme_page' filter.
  • Loading branch information
GaryJones committed May 4, 2015
2 parents a3f5a4f + 4bc1829 commit 15abf2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion class-tgm-plugin-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,11 @@ public function admin_menu() {
* @param array $args Menu item configuration.
*/
protected function add_admin_menu( array $args ) {
if ( apply_filters( 'tgmpa_admin_menu_use_add_theme_page', true ) ) {
if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) {
_deprecated_function( 'The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'tgmpa' ) );
}

if ( 'themes.php' === $this->parent_slug ) {
$this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] );

} else {
Expand Down

0 comments on commit 15abf2f

Please sign in to comment.