Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/3rd-part...
File: wpcom-reader.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* This provides minor tweaks to improve the experience for Jetpack feed in the WordPress.com Reader.
[2] Fix | Delete
*
[3] Fix | Delete
* This does not make sites available in the Reader—that depends on the public access to /feed/ as a method on the WP.com side
[4] Fix | Delete
* to check if a site is public. It also does not add any content to the feed. Any content that should not be displayed in the Reader
[5] Fix | Delete
* or other RSS readers should be filtered out elsewhere.
[6] Fix | Delete
*
[7] Fix | Delete
* These hooks were originally part of the now-deprecated Enhanced Distribution.
[8] Fix | Delete
*
[9] Fix | Delete
* @since 13.3
[10] Fix | Delete
* @package Automattic/jetpack
[11] Fix | Delete
*/
[12] Fix | Delete
[13] Fix | Delete
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
[14] Fix | Delete
use Automattic\Jetpack\Status;
[15] Fix | Delete
use Automattic\Jetpack\Status\Host;
[16] Fix | Delete
[17] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[18] Fix | Delete
exit( 0 );
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
foreach ( array( 'rss_head', 'rss1_head', 'rss2_head' ) as $rss_head_action ) {
[22] Fix | Delete
add_action( $rss_head_action, 'jetpack_wpcomreader_feed_id' );
[23] Fix | Delete
}
[24] Fix | Delete
foreach ( array( 'rss_item', 'rss1_item', 'rss2_item' ) as $rss_item_action ) {
[25] Fix | Delete
add_action( $rss_item_action, 'jetpack_wpcomreader_post_id' );
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Output feed identifier based on blog ID.
[30] Fix | Delete
*
[31] Fix | Delete
* @return void
[32] Fix | Delete
*/
[33] Fix | Delete
function jetpack_wpcomreader_feed_id() {
[34] Fix | Delete
if (
[35] Fix | Delete
( new Host() )->is_wpcom_simple()
[36] Fix | Delete
|| (
[37] Fix | Delete
( new Connection_Manager() )->is_connected()
[38] Fix | Delete
&& ! ( new Status() )->is_offline_mode()
[39] Fix | Delete
)
[40] Fix | Delete
) {
[41] Fix | Delete
$blog_id = Connection_Manager::get_site_id( true ); // Silence since we're not wanting to handle the error state.
[42] Fix | Delete
if ( ! $blog_id ) {
[43] Fix | Delete
return;
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
printf(
[47] Fix | Delete
'<site xmlns="com-wordpress:feed-additions:1">%d</site>',
[48] Fix | Delete
(int) $blog_id
[49] Fix | Delete
);
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
/**
[54] Fix | Delete
* Output feed item identifier based on current post ID.
[55] Fix | Delete
*
[56] Fix | Delete
* @return void
[57] Fix | Delete
*/
[58] Fix | Delete
function jetpack_wpcomreader_post_id() {
[59] Fix | Delete
$id = get_the_ID();
[60] Fix | Delete
if ( ! $id ) {
[61] Fix | Delete
return;
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
printf(
[65] Fix | Delete
'<post-id xmlns="com-wordpress:feed-additions:1">%d</post-id>',
[66] Fix | Delete
(int) $id
[67] Fix | Delete
);
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function