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