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
jetpack / jetpack_vendor / automattic / jetpack-sharing-likes / src / settings / class-likes-options.php

class-likes-options.php in Jetpack – WP Security, Backup, Speed, & Growth 16.3, at jetpack_vendor/automattic/jetpack-sharing-likes/src/settings/class-likes-options.php

49 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Reads the Likes options without depending on the Likes module being loaded.
4 *
5 * @package automattic/jetpack-sharing-likes
6 */
7
8 declare( strict_types = 1 );
9
10 namespace Automattic\Jetpack\Sharing_Likes\Settings;
11
12 use Jetpack_Options;
13
14 /**
15 * The Likes options, as the settings screen needs them.
16 *
17 * `Jetpack_Likes_Settings` carries equivalent accessors, but it only loads with
18 * the Likes module, and this screen renders whether that module is on or off.
19 */
20 final class Likes_Options {
21
22 /**
23 * Whether Likes are on for every post.
24 */
25 public static function likes_enabled_sitewide(): bool {
26 /** This filter is documented in projects/plugins/jetpack/modules/likes/jetpack-likes-settings.php */
27 return (bool) apply_filters(
28 'wpl_is_enabled_sitewide',
29 ! Jetpack_Options::get_option_and_ensure_autoload( 'disabled_likes', 0 )
30 );
31 }
32
33 /**
34 * Whether the Reblog button shows on posts. WordPress.com Simple only.
35 */
36 public static function reblogs_enabled_sitewide(): bool {
37 /** This filter is documented in projects/plugins/jetpack/modules/likes/jetpack-likes-settings.php */
38 return (bool) apply_filters( 'wpl_reblogging_enabled_sitewide', ! get_option( 'disabled_reblogs' ) );
39 }
40
41 /**
42 * Whether the Comment Likes option is on. Only WordPress.com Simple reads it.
43 */
44 public static function comment_likes_enabled(): bool {
45 /** This filter is documented in projects/plugins/jetpack/modules/likes/jetpack-likes-settings.php */
46 return (bool) apply_filters( 'jetpack_comment_likes_enabled', get_option( 'jetpack_comment_likes_enabled', false ) );
47 }
48 }
49