Skip to content

Commit 2d7af43

Browse files
kaeizenbfintal
andauthored
fix: display useful plugins tab only if user can install/activate plugins (#3662)
* display useful plugins tab only if user can install/activate plugins * Apply suggestion from @bfintal --------- Co-authored-by: Benjamin Intal <[email protected]>
1 parent 5e6fb4d commit 2d7af43

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/welcome/index.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,12 @@ public static function print_tabs() {
206206
</a>
207207
<?php } ?>
208208

209-
<a class="s-tab <?php echo $screen->base === 'stackable_page_stackable-useful-plugins' ? 's-active' : '' ?>"
210-
href="<?php echo admin_url( 'admin.php?page=stackable-useful-plugins' ) ?>">
211-
<span><?php _e( 'Useful Plugins', STACKABLE_I18N ) ?></span>
212-
</a>
209+
<?php if ( current_user_can( 'install_plugins' ) && current_user_can( 'activate_plugins' ) ) { ?>
210+
<a class="s-tab <?php echo $screen->base === 'stackable_page_stackable-useful-plugins' ? 's-active' : '' ?>"
211+
href="<?php echo admin_url( 'admin.php?page=stackable-useful-plugins' ) ?>">
212+
<span><?php _e( 'Useful Plugins', STACKABLE_I18N ) ?></span>
213+
</a>
214+
<?php } ?>
213215

214216
</div>
215217
<?php

0 commit comments

Comments
 (0)