Skip to content

Commit

Permalink
Added 'Details' button to plugins on Settings page
Browse files Browse the repository at this point in the history
Adds Thickbox Details link for all plugins on Settings page. Opens
Plugin Details modal window just like normal plugin administration.

Fixes #9
  • Loading branch information
nickdaugherty committed Apr 8, 2013
1 parent 8f4532f commit 7239eca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
16 changes: 13 additions & 3 deletions developer.php
Expand Up @@ -5,7 +5,7 @@
Plugin Name: Developer
Plugin URI: http://wordpress.org/extend/plugins/developer/
Description: The first stop for every WordPress developer
Version: 1.1.5
Version: 1.1.6
Author: Automattic
Author URI: http://automattic.com
License: GPLv2 or later
Expand All @@ -24,7 +24,7 @@ class Automattic_Developer {
public $settings = array();
public $default_settings = array();

const VERSION = '1.1.5';
const VERSION = '1.1.6';
const OPTION = 'a8c_developer';
const PAGE_SLUG = 'a8c_developer';

Expand Down Expand Up @@ -441,6 +441,10 @@ public function settings_page() {
// Plugins
add_settings_section( 'a8c_developer_plugins', esc_html__( 'Plugins', 'a8c-developer' ), array( $this, 'settings_section_plugins' ), self::PAGE_SLUG . '_status' );

wp_enqueue_script( 'plugin-install' );

add_thickbox();

$recommended_plugins = $this->get_recommended_plugins();

foreach ( $recommended_plugins as $plugin_slug => $plugin_details ) {
Expand All @@ -451,7 +455,13 @@ public function settings_page() {

$plugin_details = array_merge( (array) $details, array( 'slug' => $plugin_slug ), $plugin_details );

add_settings_field( 'a8c_developer_plugin_' . $plugin_slug, $plugin_details['name'], array( $this, 'settings_field_plugin' ), self::PAGE_SLUG . '_status', 'a8c_developer_plugins', $plugin_details );
$label = '<strong>' . esc_html( $plugin_details['name'] ) . '</strong>';

$label .= '<br /><a href="' . self_admin_url( 'plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin_slug .
'&amp;TB_iframe=true&amp;width=600&amp;height=550' ) . '" class="thickbox" title="' .
esc_attr( sprintf( __( 'More information about %s' ), $plugin_details['name'] ) ) . '">' . __( 'Details' ) . '</a>';

add_settings_field( 'a8c_developer_plugin_' . $plugin_slug, $label, array( $this, 'settings_field_plugin' ), self::PAGE_SLUG . '_status', 'a8c_developer_plugins', $plugin_details );
}

// Constants
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Expand Up @@ -3,7 +3,7 @@ Contributors: automattic, batmoo, Viper007Bond, nbachiyski, tott, danielbachhube
Tags: developer, development, local
Requires at least: 3.4
Tested up to: 3.5.1
Stable tag: 1.1.5
Stable tag: 1.1.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -40,6 +40,10 @@ Because you haven't asked one yet.

== Changelog ==

= 1.1.6 (2013-04-08) =
* Made purpose of activate/install links on Settings page more obvious
* Added link to full plugin details on Settings page (opens in Thickbox)

= 1.1.5 (2013-04-05) =
* Added ability to define multiple project types for plugins
* Added ability to define project types for constants
Expand Down

0 comments on commit 7239eca

Please sign in to comment.