Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/3rd-part...
File: bbpress.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Compatibility functions for bbpress.
[2] Fix | Delete
*
[3] Fix | Delete
* Only added if bbpress is active via function_exists( 'bbpress' ) in 3rd-party.php.
[4] Fix | Delete
*
[5] Fix | Delete
* @package automattic/jetpack
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
use Automattic\Jetpack\Image_CDN\Image_CDN;
[9] Fix | Delete
[10] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[11] Fix | Delete
exit( 0 );
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
// Priority 11 needed to ensure sharing_display is loaded.
[15] Fix | Delete
add_action( 'init', 'jetpack_bbpress_compat', 11 );
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* Adds Jetpack + bbPress Compatibility filters.
[19] Fix | Delete
*
[20] Fix | Delete
* @author Brandon Kraft
[21] Fix | Delete
* @since 3.7.1
[22] Fix | Delete
*/
[23] Fix | Delete
function jetpack_bbpress_compat() {
[24] Fix | Delete
/**
[25] Fix | Delete
* Add compatibility layer for REST API.
[26] Fix | Delete
*
[27] Fix | Delete
* @since 8.5.0 Moved from root-level file and check_rest_api_compat()
[28] Fix | Delete
*/
[29] Fix | Delete
require_once __DIR__ . '/class-jetpack-bbpress-rest-api.php';
[30] Fix | Delete
Jetpack_BbPress_REST_API::instance();
[31] Fix | Delete
[32] Fix | Delete
// Adds sharing buttons to bbPress items.
[33] Fix | Delete
if ( function_exists( 'sharing_display' ) ) {
[34] Fix | Delete
add_filter( 'bbp_get_topic_content', 'sharing_display', 19 );
[35] Fix | Delete
add_action( 'bbp_template_after_single_forum', 'jetpack_sharing_bbpress' );
[36] Fix | Delete
add_action( 'bbp_template_after_single_topic', 'jetpack_sharing_bbpress' );
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* Enable Markdown support for bbpress post types.
[41] Fix | Delete
*
[42] Fix | Delete
* @author Brandon Kraft
[43] Fix | Delete
* @since 6.0.0
[44] Fix | Delete
*/
[45] Fix | Delete
if ( function_exists( 'bbp_get_topic_post_type' ) ) {
[46] Fix | Delete
add_post_type_support( bbp_get_topic_post_type(), 'wpcom-markdown' );
[47] Fix | Delete
add_post_type_support( bbp_get_reply_post_type(), 'wpcom-markdown' );
[48] Fix | Delete
add_post_type_support( bbp_get_forum_post_type(), 'wpcom-markdown' );
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Use Photon for all images in Topics and replies.
[53] Fix | Delete
*
[54] Fix | Delete
* @since 4.9.0
[55] Fix | Delete
*/
[56] Fix | Delete
if ( class_exists( Image_CDN::class ) && Image_CDN::is_enabled() ) {
[57] Fix | Delete
add_filter( 'bbp_get_topic_content', array( Image_CDN::class, 'filter_the_content' ), 999999 );
[58] Fix | Delete
add_filter( 'bbp_get_reply_content', array( Image_CDN::class, 'filter_the_content' ), 999999 );
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* Display Jetpack "Sharing" buttons on bbPress 2.x forums/ topics/ lead topics/ replies.
[64] Fix | Delete
*
[65] Fix | Delete
* Determination if the sharing buttons should display on the post type is handled within sharing_display().
[66] Fix | Delete
*
[67] Fix | Delete
* @author David Decker
[68] Fix | Delete
* @since 3.7.0
[69] Fix | Delete
*/
[70] Fix | Delete
function jetpack_sharing_bbpress() {
[71] Fix | Delete
sharing_display( null, true );
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function