diff --git a/class-tgm-plugin-activation.php b/class-tgm-plugin-activation.php index e26ceafd..48e29ea8 100755 --- a/class-tgm-plugin-activation.php +++ b/class-tgm-plugin-activation.php @@ -351,14 +351,26 @@ public function admin_menu() { foreach ( $this->plugins as $plugin ) { if ( ! is_plugin_active( $plugin['file_path'] ) ) { - add_theme_page( - $this->strings['page_title'], // Page title. - $this->strings['menu_title'], // Menu title. - 'edit_theme_options', // Capability. - $this->menu, // Menu slug. - array( $this, 'install_plugins_page' ) // Callback. - ); - break; + + $args = apply_filters( + 'tgmpa_admin_menu_args', + array( + 'parent_slug'=> 'themes.php', // Parent Menu slug. + 'page_title' => $this->strings['page_title'], // Page title. + 'menu_title' => $this->strings['menu_title'], // Menu title. + 'capability' => 'edit_theme_options', // Capability. + 'menu_slug' => $this->menu, // Menu slug. + 'function' => array( $this, 'install_plugins_page' ) // Callback. + ) + ); + + if( apply_filters( 'tgmpa_admin_menu_use_add_theme_page', true ) ) { + add_theme_page($args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function']); + } else { + add_submenu_page( $args['parent_slug'], $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function']); + } + + break; } } @@ -616,7 +628,7 @@ public function notices() { foreach ( $this->plugins as $plugin ) { // If the plugin is installed and active, check for minimum version argument before moving forward. - if ( is_plugin_active( $plugin['file_path'] ) ) { + if ( is_plugin_active( $plugin['file_path'] ) || ( isset( $plugin['is_callable'] ) && is_callable( $plugin['is_callable'] ) ) ) { // A minimum version has been specified. if ( isset( $plugin['version'] ) ) { if ( isset( $installed_plugins[$plugin['file_path']]['Version'] ) ) { @@ -748,7 +760,7 @@ public function notices() { $action_links = array_filter( $action_links ); // Remove any empty array items. if ( $action_links ) { - $rendered .= '

' . implode( ' | ', $action_links ) . '

'; + $rendered .= apply_filters( 'tgmpa_notice_rendered_action_links', '

' . implode( ' | ', $action_links ) . '

' ); } // Register the nag messages and prepare them to be processed. @@ -1133,7 +1145,7 @@ protected function _gather_plugin_data() { $installed_plugins = get_plugins(); foreach ( TGM_Plugin_Activation::$instance->plugins as $plugin ) { - if ( is_plugin_active( $plugin['file_path'] ) ) { + if ( is_plugin_active( $plugin['file_path'] ) || ( isset( $plugin['is_callable'] ) && is_callable( $plugin['is_callable'] ) ) ) { continue; // No need to display plugins if they are installed and activated. } @@ -1193,6 +1205,8 @@ protected function _gather_plugin_data() { $table_data[$i]['file_path'] = $plugin['file_path']; $table_data[$i]['url'] = isset( $plugin['source'] ) ? $plugin['source'] : 'repo'; + $table_data[$i] = apply_filters( 'tgmpa_table_data_item', $table_data[$i], $plugin ); + $i++; } @@ -1380,7 +1394,7 @@ public function get_columns() { 'status' => __( 'Status', 'tgmpa' ) ); - return $columns; + return apply_filters( 'tgmpa_table_columns', $columns ); }