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-instagram-feed.php

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

40 lines 1.1 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 /**
5 * Instagram Feed integration for Embed Privacy.
6 *
7 * @author Epiphyt
8 * @license GPL2
9 * @package epiphyt\Embed_Privacy
10 * @since 1.10.9
11 */
12 final class Instagram_Feed {
13 /**
14 * Initialize functionality.
15 */
16 public static function init() {
17 \add_filter( 'embed_privacy_should_replace_match', [ self::class, 'should_replace_match' ], 10, 3 );
18 }
19
20 /**
21 * Check the matched content whether it comes from Instagram Feed.
22 *
23 * @param bool $should_replace Whether the replacement should take place
24 * @param string $matched_content Actual matched content
25 * @param \epiphyt\Embed_privacy\embed\Provider $provider Provider object
26 * @return bool Whether the replacement should take place
27 */
28 public static function should_replace_match( $should_replace, $matched_content, $provider ) {
29 if ( ! $should_replace ) {
30 return $should_replace;
31 }
32
33 if ( $provider->get_name() !== 'instagram' ) {
34 return $should_replace;
35 }
36
37 return ! \str_contains( $matched_content, 'class="sbi_' );
38 }
39 }
40