Skip to content

Commit

Permalink
Add the PRO link
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Apr 23, 2020
1 parent a8aaac5 commit 3fd2527
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

.widget-context .widget-context-header { float:left; width:100%; clear:both; }
.widget-context .widget-context-header h3 { font-size:1.1em; margin:0 0.5em 0.5em 0; padding:0; float:left; }
.widget-context .widget-context-header a { float:right; }
.widget-context .widget-context-header { color:#ccc; }

.widget-context .context-group { float:left; width:100%; clear:both; margin-bottom:0.5em; }
.widget-context .context-toggle { margin:0 0 0.3em 0; display:block; text-decoration:none; color:inherit; font-weight:bold; }
Expand Down
15 changes: 10 additions & 5 deletions src/WidgetContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,29 +665,34 @@ function display_widget_context( $widget_id = null ) {
}
}

$settings_link = '';
$settings_link = array();

if ( current_user_can( 'edit_theme_options' ) ) {
$settings_link = sprintf(
'<a href="%s" class="widget-context-settings-link" title="%s" target="_blank">%s</a>',
$settings_link[] = sprintf(
'<a href="%s" title="%s" target="_blank">%s</a>',
admin_url( 'options-general.php?page=widget_context_settings' ),
esc_attr__( 'Widget Context Settings', 'widget-context' ),
esc_html__( 'Settings', 'widget-context' )
);

$settings_link[] = sprintf(
'<a href="%s" target="_blank">PRO 🚀</a>',
esc_url( 'https://widgetcontext.com/pro' )
);
}

return sprintf(
'<div class="widget-context">
<div class="widget-context-header">
<h3>%s</h3>
%s
<span class="widget-context-settings-link">%s</span>
</div>
<div class="widget-context-inside" id="widget-context-%s" data-widget-id="%s">
%s
</div>
</div>',
__( 'Widget Context', 'widget-context' ),
$settings_link,
implode( ' | ', $settings_link ),
// Inslide classes
esc_attr( $widget_id ),
esc_attr( $widget_id ),
Expand Down

0 comments on commit 3fd2527

Please sign in to comment.