Skip to content

Commit

Permalink
Conditionally show admin settings
Browse files Browse the repository at this point in the history
  • Loading branch information
wpsmith committed Nov 7, 2013
1 parent f60d50e commit 49982eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions gs-featured-content-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ function gsfc_widgets_init() {
* @return array $links Maybe modified array of links.
*/
function gsfc_action_links( $links, $file ) {
if ( $file == WPS_WPCM_PLUGIN_FILE ) {
array_unshift( $links, sprintf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=genesis' ), __( 'Settings', 'gsfc' ) ) );
if ( $file == plugin_basename( __FILE__ ) ) {
if ( class_exists( 'Genesis_Featured_Widget_Amplified' ) )
array_unshift( $links, sprintf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=genesis' ), __( 'Settings', 'gsfc' ) ) );
array_unshift( $links, sprintf( '<a href="%s">%s</a>', admin_url( 'widgets.php' ), __( 'Widgets', 'gsfc' ) ) );
array_push( $links, sprintf( '<a href="http://wpsmith.net/donation" target="_blank">%s</a>', __( 'Donate', 'gsfc' ) ) );
}
Expand Down
3 changes: 2 additions & 1 deletion gsfc-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public function add_admin_menu() {
* @since 1.1.0
*/
public function add_metabox() {
add_meta_box( 'gsfc-settings', __( 'Genesis Sandbox Featured Content Settings', 'gsfc' ), array( $this, 'settings' ), $this->pagehook, 'main', 'high' );
if ( class_exists( 'Genesis_Featured_Widget_Amplified' ) )
add_meta_box( 'gsfc-settings', __( 'Genesis Sandbox Featured Content Settings', 'gsfc' ), array( $this, 'settings' ), $this->pagehook, 'main', 'high' );
}

/**
Expand Down

0 comments on commit 49982eb

Please sign in to comment.