PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 14.8
Jetpack – WP Security, Backup, Speed, & Growth v14.8
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 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / 3rd-party / bbpress.php
bbpress.php
71 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Compatibility functions for bbpress.
4 *
5 * Only added if bbpress is active via function_exists( 'bbpress' ) in 3rd-party.php.
6 *
7 * @package automattic/jetpack
8 */
9
10 use Automattic\Jetpack\Image_CDN\Image_CDN;
11
12 // Priority 11 needed to ensure sharing_display is loaded.
13 add_action( 'init', 'jetpack_bbpress_compat', 11 );
14
15 /**
16 * Adds Jetpack + bbPress Compatibility filters.
17 *
18 * @author Brandon Kraft
19 * @since 3.7.1
20 */
21 function jetpack_bbpress_compat() {
22 /**
23 * Add compatibility layer for REST API.
24 *
25 * @since 8.5.0 Moved from root-level file and check_rest_api_compat()
26 */
27 require_once __DIR__ . '/class-jetpack-bbpress-rest-api.php';
28 Jetpack_BbPress_REST_API::instance();
29
30 // Adds sharing buttons to bbPress items.
31 if ( function_exists( 'sharing_display' ) ) {
32 add_filter( 'bbp_get_topic_content', 'sharing_display', 19 );
33 add_action( 'bbp_template_after_single_forum', 'jetpack_sharing_bbpress' );
34 add_action( 'bbp_template_after_single_topic', 'jetpack_sharing_bbpress' );
35 }
36
37 /**
38 * Enable Markdown support for bbpress post types.
39 *
40 * @author Brandon Kraft
41 * @since 6.0.0
42 */
43 if ( function_exists( 'bbp_get_topic_post_type' ) ) {
44 add_post_type_support( bbp_get_topic_post_type(), 'wpcom-markdown' );
45 add_post_type_support( bbp_get_reply_post_type(), 'wpcom-markdown' );
46 add_post_type_support( bbp_get_forum_post_type(), 'wpcom-markdown' );
47 }
48
49 /**
50 * Use Photon for all images in Topics and replies.
51 *
52 * @since 4.9.0
53 */
54 if ( class_exists( Image_CDN::class ) && Image_CDN::is_enabled() ) {
55 add_filter( 'bbp_get_topic_content', array( Image_CDN::class, 'filter_the_content' ), 999999 );
56 add_filter( 'bbp_get_reply_content', array( Image_CDN::class, 'filter_the_content' ), 999999 );
57 }
58 }
59
60 /**
61 * Display Jetpack "Sharing" buttons on bbPress 2.x forums/ topics/ lead topics/ replies.
62 *
63 * Determination if the sharing buttons should display on the post type is handled within sharing_display().
64 *
65 * @author David Decker
66 * @since 3.7.0
67 */
68 function jetpack_sharing_bbpress() {
69 sharing_display( null, true );
70 }
71