PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 9.5
Jetpack – WP Security, Backup, Speed, & Growth v9.5
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 in Jetpack – WP Security, Backup, Speed, & Growth 9.5, at 3rd-party/bbpress.php

70 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 * @package automattic/jetpack
6 */
7
8 add_action( 'init', 'jetpack_bbpress_compat', 11 ); // Priority 11 needed to ensure sharing_display is loaded.
9
10 /**
11 * Adds Jetpack + bbPress Compatibility filters.
12 *
13 * @author Brandon Kraft
14 * @since 3.7.1
15 */
16 function jetpack_bbpress_compat() {
17 if ( ! function_exists( 'bbpress' ) ) {
18 return;
19 }
20
21 /**
22 * Add compatibility layer for REST API.
23 *
24 * @since 8.5.0 Moved from root-level file and check_rest_api_compat()
25 */
26 require_once 'class-jetpack-bbpress-rest-api.php';
27 Jetpack_BbPress_REST_API::instance();
28
29 // Adds sharing buttons to bbPress items.
30 if ( function_exists( 'sharing_display' ) ) {
31 add_filter( 'bbp_get_topic_content', 'sharing_display', 19 );
32 add_action( 'bbp_template_after_single_forum', 'jetpack_sharing_bbpress' );
33 add_action( 'bbp_template_after_single_topic', 'jetpack_sharing_bbpress' );
34 }
35
36 /**
37 * Enable Markdown support for bbpress post types.
38 *
39 * @author Brandon Kraft
40 * @since 6.0.0
41 */
42 if ( function_exists( 'bbp_get_topic_post_type' ) ) {
43 add_post_type_support( bbp_get_topic_post_type(), 'wpcom-markdown' );
44 add_post_type_support( bbp_get_reply_post_type(), 'wpcom-markdown' );
45 add_post_type_support( bbp_get_forum_post_type(), 'wpcom-markdown' );
46 }
47
48 /**
49 * Use Photon for all images in Topics and replies.
50 *
51 * @since 4.9.0
52 */
53 if ( class_exists( 'Jetpack_Photon' ) && Jetpack::is_module_active( 'photon' ) ) {
54 add_filter( 'bbp_get_topic_content', array( 'Jetpack_Photon', 'filter_the_content' ), 999999 );
55 add_filter( 'bbp_get_reply_content', array( 'Jetpack_Photon', 'filter_the_content' ), 999999 );
56 }
57 }
58
59 /**
60 * Display Jetpack "Sharing" buttons on bbPress 2.x forums/ topics/ lead topics/ replies.
61 *
62 * Determination if the sharing buttons should display on the post type is handled within sharing_display().
63 *
64 * @author David Decker
65 * @since 3.7.0
66 */
67 function jetpack_sharing_bbpress() {
68 sharing_display( null, true );
69 }
70