| @@ -22,15 +22,16 @@ | ||
| 22 | 22 | * |
| 23 | 23 | * @return void |
| 24 | 24 | */ |
| 25 | 25 | function register_plugins() { |
| 26 | - /* | |
| 27 | - * The extension is available even when the module is not active, | |
| 28 | - * so we can display a nudge to activate the module instead of the block. | |
| 29 | - * We skip that nudge for non-admins, who cannot activate modules, and on block themes, | |
| 30 | - * where the answer is the Like block in a template rather than the legacy module. | |
| 31 | - */ | |
| 32 | - if ( ! ( new Modules() )->is_active( 'likes' ) && ( ! current_user_can( 'jetpack_activate_modules' ) || wp_is_block_theme() ) ) { | |
| 26 | + $modules = new Modules(); | |
| 27 | + | |
| 28 | + // The panel's per-post switch applies to Like buttons and Comment Likes alike. | |
| 29 | + $shows_switch = $modules->is_active( 'likes' ) || $modules->is_active( 'comment-likes' ); | |
| 30 | + | |
| 31 | + // Without it, the panel can only nudge to activate Likes. Skip that for users who can't, | |
| 32 | + // and on block themes, where the Like block in a template replaces the legacy module. | |
| 33 | + if ( ! $shows_switch && ( ! current_user_can( 'jetpack_activate_modules' ) || wp_is_block_theme() ) ) { | |
| 33 | 34 | return; |
| 34 | 35 | } |
| 35 | 36 | |
| 36 | 37 | // Register Likes. |