PluginProbe
Friends / 2.9.0
Friends v2.9.0
4.3.2 4.3.1 4.3.0 4.2.2 4.2.1 4.2.0 4.1.0 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.1 All 88 releases
friends / includes / class-third-parties.php

class-third-parties.php in Friends 2.9.0, at includes/class-third-parties.php

71 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Friends 3rd Parties
4 *
5 * This contains the functions for working with third party plugins.
6 *
7 * @package Friends
8 */
9
10 namespace Friends;
11
12 /**
13 * This is the class for the Friends Plugin 3rd Party handling.
14 *
15 * @since 0.6
16 *
17 * @package Friends
18 * @author Alex Kirk
19 */
20 class Third_Parties {
21 /**
22 * Contains a reference to the Friends class.
23 *
24 * @var Friends
25 */
26 private $friends = null;
27
28 /**
29 * Constructor
30 *
31 * @param Friends $friends A reference to the Friends object.
32 */
33 public function __construct( Friends $friends ) {
34 $this->friends = $friends;
35 $this->register_hooks();
36 }
37
38 /**
39 * Register the WordPress hooks
40 */
41 private function register_hooks() {
42 add_filter( 'option_fx-private-site', array( $this, 'fx_private_site' ) );
43 add_filter( 'wp_sweep_excluded_taxonomies', array( $this, 'wp_sweep_excluded_taxonomies' ) );
44 }
45
46 /**
47 * Allow accessing the private feed when the FX Private Site plugin is installed.
48 *
49 * @param mixed $value Value of the option.
50 */
51 public function fx_private_site( $value ) {
52 if ( $this->friends->access_control->feed_is_authenticated() ) {
53 $value['enable'] = false;
54 }
55 return $value;
56 }
57
58 /**
59 * WP Sweep
60 * Prevent WP Sweep from sweeping our taxonomies.
61 *
62 * @since 2.0
63 *
64 * @param array $excluded_taxonomies list of taxonomies excluded from sweeping.
65 * @return array
66 */
67 public function wp_sweep_excluded_taxonomies( $excluded_taxonomies ) {
68 return array_merge( $excluded_taxonomies, array( User_Feed::TAXONOMY, Subscription::TAXONOMY ) );
69 }
70 }
71