File Editor
Directories:
.. (Back)
calypsoify
carousel
cloudflare-analytics
comment-likes
comments
contact-form
custom-css
custom-post-types
geo-location
google-analytics
gravatar
infinite-scroll
likes
markdown
masterbar
memberships
photon-cdn
plugin-search
post-by-email
related-posts
scan
seo-tools
sharedaddy
shortcodes
simple-payments
site-icon
sitemaps
sso
stats
subscriptions
theme-tools
tiled-gallery
verification-tools
videopress
widget-visibility
widgets
woocommerce-analytics
wordads
wpcom-block-editor
wpcom-tos
Files:
action-bar.php
blaze.php
carousel.php
comment-likes.php
comments.php
contact-form.php
copy-post.php
custom-content-types.php
custom-css.php
enhanced-distribution.php
geo-location.php
google-analytics.php
google-fonts.php
gravatar-hovercards.php
infinite-scroll.php
json-api.php
latex.php
lazy-images.php
likes.php
markdown.php
masterbar.php
module-extras.php
module-headings.php
module-info.php
monitor.php
notes.php
photon-cdn.php
photon.php
plugin-search.php
post-by-email.php
post-list.php
protect.php
publicize.php
related-posts.php
search.php
seo-tools.php
sharedaddy.php
shortcodes.php
shortlinks.php
sitemaps.php
sso.php
stats.php
subscriptions.php
theme-tools.php
tiled-gallery.php
vaultpress.php
verification-tools.php
videopress.php
waf.php
widget-visibility.php
widgets.php
woocommerce-analytics.php
wordads.php
wpgroho.js
Create New File
Create
Edit File: enhanced-distribution.php
<?php /** * Module Name: Enhanced Distribution * Module Description: Increase reach and traffic. * Sort Order: 5 * First Introduced: 1.2 * Requires Connection: Yes * Auto Activate: Public * Module Tags: Writing * Feature: Engagement * Additional Search Queries: google, seo, firehose, search, broadcast, broadcasting * * @package automattic/jetpack */ /** * In case it's active prior to upgrading to '1.9'. */ function jetpack_enhanced_distribution_before_activate_default_modules() { $old_version = Jetpack_Options::get_option( 'old_version' ); list( $old_version ) = explode( ':', $old_version ); if ( version_compare( $old_version, '1.9-something', '>=' ) ) { return; } Jetpack::check_privacy( __FILE__ ); } add_action( 'jetpack_before_activate_default_modules', 'jetpack_enhanced_distribution_before_activate_default_modules' ); if ( isset( $_GET['get_freshly_pressed_data'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended /** * If a request has ?get_freshly_pressed_data=true appended * to the end, then let's provide the necessary data back via JSON. */ function jetpack_get_freshly_pressed_data() { if ( is_single() ) { wp_send_json_success( array( 'blog_id' => Jetpack_Options::get_option( 'id' ), 'post_id' => get_the_ID(), ) ); } else { wp_send_json_error( array( 'message' => 'Not Singular', ) ); } } add_action( 'template_redirect', 'jetpack_get_freshly_pressed_data' ); } add_action( 'rss_head', 'jetpack_enhanced_distribution_feed_id' ); add_action( 'rss_item', 'jetpack_enhanced_distribution_post_id' ); add_action( 'rss2_head', 'jetpack_enhanced_distribution_feed_id' ); add_action( 'rss2_item', 'jetpack_enhanced_distribution_post_id' ); /** * Output feed identifier based on blog ID. */ function jetpack_enhanced_distribution_feed_id() { $id = (int) Jetpack_Options::get_option( 'id' ); if ( $id > 0 ) { $output = sprintf( '<site xmlns="com-wordpress:feed-additions:1">%d</site>', $id ); echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } /** * Output feed item identifier based on current post ID. */ function jetpack_enhanced_distribution_post_id() { $id = (int) get_the_ID(); if ( $id ) { $output = sprintf( '<post-id xmlns="com-wordpress:feed-additions:1">%d</post-id>', $id ); echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } }
Save Changes
Rename File
Rename