PluginProbe
Embed Privacy / 1.11.2
Embed Privacy v1.11.2
1.14.0 1.13.0 trunk 0.1 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 1.10.0 1.10.1 1.10.10 1.10.2 1.10.3 1.10.4 1.10.5 1.10.6 1.10.7 1.10.8 1.10.9 1.11.0 1.11.1 1.11.2 All 68 releases
embed-privacy / inc / integration / class-buddypress.php

class-buddypress.php in Embed Privacy 1.11.2, at inc/integration/class-buddypress.php

49 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace epiphyt\Embed_Privacy\integration;
3
4 use epiphyt\Embed_Privacy\data\Replacer;
5 use epiphyt\Embed_Privacy\Embed_Privacy;
6
7 /**
8 * BuddyPress integration for Embed Privacy.
9 *
10 * @author Epiphyt
11 * @license GPL2
12 * @package epiphyt\Embed_Privacy
13 * @since 1.11.0
14 */
15 final class Buddypress {
16 /**
17 * Initialize functionality.
18 */
19 public static function init() {
20 \add_action( 'bp_enqueue_community_scripts', [ self::class, 'register_scripts' ], 2 );
21 \add_action( 'bp_enqueue_community_scripts', [ self::class, 'enqueue_assets' ] );
22 \add_filter( 'bp_get_activity_content_body', [ self::class, 'replace_activity_content' ] );
23 }
24
25 /**
26 * Enqueue Embed Privacy assets for BuddyPress.
27 */
28 public static function enqueue_assets() {
29 Embed_Privacy::get_instance()->frontend->print_assets();
30 }
31
32 /**
33 * Register Embed Privacy assets for BuddyPress.
34 */
35 public static function register_scripts() {
36 Embed_Privacy::get_instance()->frontend->register_assets();
37 }
38
39 /**
40 * Replace activity stream content.
41 *
42 * @param string $content Current activity stream content
43 * @return string Updated activity stream content
44 */
45 public static function replace_activity_content( $content ) {
46 return Replacer::replace_embeds( $content );
47 }
48 }
49