PluginProbe
Embed Privacy / 1.10.4
Embed Privacy v1.10.4
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-activitypub.php

class-activitypub.php in Embed Privacy 1.10.4, at inc/integration/class-activitypub.php

35 lines 905 B
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 * ActivityPub integration for Embed Privacy.
6 *
7 * @author Epiphyt
8 * @license GPL2
9 * @package epiphyt\Embed_Privacy
10 * @since 1.10.0
11 */
12 final class Activitypub {
13 /**
14 * Initialize functionality.
15 */
16 public static function init() {
17 \add_filter( 'embed_privacy_is_ignored_request', [ self::class, 'set_ignored_request' ] );
18 }
19
20 /**
21 * Set whether the current request is an ActivityPub request and thus should be ignored.
22 * Return the unaltered value if it's already ignored.
23 *
24 * @param bool $is_ignored Whether the current request is ignored
25 * @return bool Whether the current request is ignored
26 */
27 public static function set_ignored_request( $is_ignored ) {
28 if ( $is_ignored ) {
29 return $is_ignored;
30 }
31
32 return \function_exists( 'Activitypub\is_activitypub_request' ) && \Activitypub\is_activitypub_request();
33 }
34 }
35