calypsoify
2 years ago
carousel
2 years ago
cloudflare-analytics
4 years ago
comment-likes
5 years ago
comments
2 years ago
contact-form
2 years ago
custom-css
2 years ago
custom-post-types
2 years ago
geo-location
4 years ago
google-analytics
2 years ago
google-fonts
2 years ago
gravatar
6 years ago
infinite-scroll
2 years ago
likes
2 years ago
markdown
2 years ago
masterbar
2 years ago
memberships
2 years ago
photon-cdn
2 years ago
plugin-search
4 years ago
post-by-email
3 years ago
related-posts
2 years ago
scan
2 years ago
seo-tools
2 years ago
sharedaddy
2 years ago
shortcodes
2 years ago
simple-payments
3 years ago
site-icon
4 years ago
sitemaps
2 years ago
sso
2 years ago
stats
2 years ago
subscriptions
2 years ago
theme-tools
2 years ago
tiled-gallery
2 years ago
verification-tools
4 years ago
videopress
2 years ago
widget-visibility
2 years ago
widgets
2 years ago
woocommerce-analytics
2 years ago
wordads
2 years ago
wpcom-block-editor
2 years ago
wpcom-tos
5 years ago
blaze.php
2 years ago
carousel.php
2 years ago
comment-likes.php
2 years ago
comments.php
2 years ago
contact-form.php
2 years ago
copy-post.php
2 years ago
custom-content-types.php
4 years ago
custom-css.php
3 years ago
enhanced-distribution.php
2 years ago
geo-location.php
4 years ago
google-analytics.php
4 years ago
google-fonts.php
2 years ago
gravatar-hovercards.php
2 years ago
infinite-scroll.php
3 years ago
json-api.php
5 years ago
latex.php
4 years ago
likes.php
2 years ago
markdown.php
4 years ago
masterbar.php
2 years ago
module-extras.php
4 years ago
module-headings.php
2 years ago
module-info.php
2 years ago
monitor.php
2 years ago
notes.php
2 years ago
photon-cdn.php
2 years ago
photon.php
3 years ago
plugin-search.php
2 years ago
post-by-email.php
5 years ago
post-list.php
4 years ago
protect.php
3 years ago
publicize.php
2 years ago
related-posts.php
2 years ago
search.php
4 years ago
seo-tools.php
2 years ago
sharedaddy.php
2 years ago
shortcodes.php
2 years ago
shortlinks.php
2 years ago
sitemaps.php
4 years ago
sso.php
2 years ago
stats.php
2 years ago
subscriptions.php
2 years ago
theme-tools.php
3 years ago
tiled-gallery.php
4 years ago
vaultpress.php
2 years ago
verification-tools.php
5 years ago
videopress.php
4 years ago
waf.php
3 years ago
widget-visibility.php
4 years ago
widgets.php
3 years ago
woocommerce-analytics.php
2 years ago
wordads.php
2 years ago
wpgroho.js
6 years ago
related-posts.php
67 lines
| 1 | <?php //phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | /** |
| 3 | * Module Name: Related posts |
| 4 | * Module Description: Keep visitors engaged on your blog by highlighting relevant and new content at the bottom of each published post. |
| 5 | * First Introduced: 2.9 |
| 6 | * Sort Order: 29 |
| 7 | * Recommendation Order: 9 |
| 8 | * Requires Connection: Yes |
| 9 | * Auto Activate: No |
| 10 | * Module Tags: Recommended |
| 11 | * Feature: Engagement |
| 12 | * // phpcs:ignore WordPress.WP.CapitalPDangit.MisspelledInComment |
| 13 | * Additional Search Queries: related, jetpack related posts, related posts for wordpress, related posts, popular posts, popular, related content, related post, contextual, context, contextual related posts, related articles, similar posts, easy related posts, related page, simple related posts, free related posts, related thumbnails, similar, engagement, yet another related posts plugin, creator |
| 14 | */ |
| 15 | class Jetpack_RelatedPosts_Module { |
| 16 | /** |
| 17 | * Class variables |
| 18 | * |
| 19 | * @var Jetpack_RelatedPosts_Module |
| 20 | */ |
| 21 | private static $instance = null; |
| 22 | |
| 23 | /** |
| 24 | * Singleton implementation |
| 25 | * |
| 26 | * @return object |
| 27 | */ |
| 28 | public static function instance() { |
| 29 | if ( ! is_a( self::$instance, 'Jetpack_RelatedPosts_Module' ) ) { |
| 30 | self::$instance = new Jetpack_RelatedPosts_Module(); |
| 31 | } |
| 32 | |
| 33 | return self::$instance; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Register actions and filters |
| 38 | * |
| 39 | * @uses add_action, add_filter |
| 40 | */ |
| 41 | private function __construct() { |
| 42 | add_action( 'jetpack_module_loaded_related-posts', array( $this, 'action_on_load' ) ); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * This action triggers if the module is in an active state, load related posts and options. |
| 47 | * |
| 48 | * @uses Jetpack_RelatedPosts::init, is_admin, Jetpack::enable_module_configurable, Jetpack_Sync::sync_posts |
| 49 | */ |
| 50 | public function action_on_load() { |
| 51 | require_once __DIR__ . '/related-posts/jetpack-related-posts.php'; |
| 52 | Jetpack_RelatedPosts::init(); |
| 53 | |
| 54 | if ( is_admin() ) { |
| 55 | Jetpack::enable_module_configurable( __FILE__ ); |
| 56 | } |
| 57 | |
| 58 | // Load Customizer controls. |
| 59 | if ( class_exists( WP_Customize_Manager::class ) && class_exists( WP_Customize_Control::class ) ) { |
| 60 | require_once __DIR__ . '/related-posts/class.related-posts-customize.php'; |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | // Do it. |
| 66 | Jetpack_RelatedPosts_Module::instance(); |
| 67 |