Skip to content

Commit bf19ee7

Browse files
committed
Only show button on single-sites when the user can install plugins
1 parent 2b663a3 commit bf19ee7

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

classes/suggested-tasks/providers/class-disable-comments.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,14 @@ public function print_popover_form_contents() {
145145
<button type="submit" class="prpl-button prpl-button-primary" style="color: #fff;">
146146
<?php \esc_html_e( 'Disable new comments', 'progress-planner' ); ?>
147147
</button>
148-
<prpl-install-plugin
149-
data-plugin-name="Comment-free zone"
150-
data-plugin-slug="comment-free-zone"
151-
data-action="<?php echo \progress_planner()->get_plugin_installer()->is_plugin_installed( 'comment-free-zone' ) ? 'activate' : 'install'; ?>"
152-
data-provider-id="<?php echo \esc_attr( self::PROVIDER_ID ); ?>"
153-
></prpl-install-plugin>
148+
<?php if ( ! \is_multisite() && \current_user_can( 'install_plugins' ) ) : ?>
149+
<prpl-install-plugin
150+
data-plugin-name="Comment-free zone"
151+
data-plugin-slug="comment-free-zone"
152+
data-action="<?php echo \progress_planner()->get_plugin_installer()->is_plugin_installed( 'comment-free-zone' ) ? 'activate' : 'install'; ?>"
153+
data-provider-id="<?php echo \esc_attr( self::PROVIDER_ID ); ?>"
154+
></prpl-install-plugin>
155+
<?php endif; ?>
154156
<?php
155157
}
156158
}

0 commit comments

Comments
 (0)