PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | extensions/plugins/likes/likes.php +8 -7 16.3-a.7 → 16.3 View file →
@@ -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.