summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/3rd-party/bbpress.php')
-rw-r--r--plugins/jetpack/3rd-party/bbpress.php31
1 files changed, 25 insertions, 6 deletions
diff --git a/plugins/jetpack/3rd-party/bbpress.php b/plugins/jetpack/3rd-party/bbpress.php
index 0af7e028..86d6f13f 100644
--- a/plugins/jetpack/3rd-party/bbpress.php
+++ b/plugins/jetpack/3rd-party/bbpress.php
@@ -1,4 +1,10 @@
<?php
+/**
+ * Compatibility functions for bbpress.
+ *
+ * @package automattic/jetpack
+ */
+
add_action( 'init', 'jetpack_bbpress_compat', 11 ); // Priority 11 needed to ensure sharing_display is loaded.
/**
@@ -8,8 +14,21 @@ add_action( 'init', 'jetpack_bbpress_compat', 11 ); // Priority 11 needed to ens
* @since 3.7.1
*/
function jetpack_bbpress_compat() {
+ if ( ! function_exists( 'bbpress' ) ) {
+ return;
+ }
+
+ /**
+ * Add compatibility layer for REST API.
+ *
+ * @since 8.5.0 Moved from root-level file and check_rest_api_compat()
+ */
+ require_once 'class-jetpack-bbpress-rest-api.php';
+ Jetpack_BbPress_REST_API::instance();
+
+ // Adds sharing buttons to bbPress items.
if ( function_exists( 'sharing_display' ) ) {
- add_filter( 'bbp_get_topic_content', 'sharing_display', 19 );
+ add_filter( 'bbp_get_topic_content', 'sharing_display', 19 );
add_action( 'bbp_template_after_single_forum', 'jetpack_sharing_bbpress' );
add_action( 'bbp_template_after_single_topic', 'jetpack_sharing_bbpress' );
}
@@ -20,11 +39,11 @@ function jetpack_bbpress_compat() {
* @author Brandon Kraft
* @since 6.0.0
*/
- if ( function_exists( 'bbp_get_topic_post_type' ) ) {
- add_post_type_support( bbp_get_topic_post_type(), 'wpcom-markdown' );
- add_post_type_support( bbp_get_reply_post_type(), 'wpcom-markdown' );
- add_post_type_support( bbp_get_forum_post_type(), 'wpcom-markdown' );
- }
+ if ( function_exists( 'bbp_get_topic_post_type' ) ) {
+ add_post_type_support( bbp_get_topic_post_type(), 'wpcom-markdown' );
+ add_post_type_support( bbp_get_reply_post_type(), 'wpcom-markdown' );
+ add_post_type_support( bbp_get_forum_post_type(), 'wpcom-markdown' );
+ }
/**
* Use Photon for all images in Topics and replies.