Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/tutor-pro/addons/buddypress/buddypress.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 + /**
3 + * Buddypress Integration
4 + *
5 + * @package TutorPro\Addons
6 + * @subpackage Buddypress
7 + * @author Themeum <support@themeum.com>
8 + * @link https://themeum.com
9 + * @since 1.3.5
10 + */
11 +
12 + if ( ! defined( 'ABSPATH' ) ) {
13 + exit;
14 + }
15 +
16 + /**
17 + * Defined the tutor main file
18 + */
19 + define( 'TUTOR_BP_VERSION', '1.0.0' );
20 + define( 'TUTOR_BP_FILE', __FILE__ );
21 +
22 + add_filter( 'tutor_addons_lists_config', 'tutor_bp_config' );
23 + /**
24 + * Showing config for addons central lists
25 + *
26 + * @param array $config config.
27 + *
28 + * @return array
29 + */
30 + function tutor_bp_config( $config ) {
31 + $buddy_press = ABSPATH . 'wp-content/plugins/buddypress/bp-loader.php';
32 + $buddy_boss = ABSPATH . 'wp-content/plugins/buddyboss-platform/bp-loader.php';
33 + $required_plugin = 'buddypress/bp-loader.php';
34 +
35 + if ( ! file_exists( $buddy_press ) && file_exists( $buddy_boss ) ) {
36 + $required_plugin = 'buddyboss-platform/bp-loader.php';
37 + }
38 +
39 + $new_config = array(
40 + 'name' => __( 'BuddyPress', 'tutor-pro' ),
41 + 'description' => __( 'Boost engagement with social features through BuddyPress for Tutor LMS.', 'tutor-pro' ),
42 + 'depend_plugins' => array( $required_plugin => 'BuddyPress' ),
43 + );
44 +
45 + $basic_config = (array) TUTOR_BP();
46 + $new_config = array_merge( $new_config, $basic_config );
47 +
48 + $config[ plugin_basename( TUTOR_BP_FILE ) ] = $new_config;
49 + return $config;
50 + }
51 +
52 + if ( ! function_exists( 'TUTOR_BP' ) ) {
53 + /**
54 + * Buddypress addon helper
55 + *
56 + * @return object
57 + */
58 + //phpcs:ignore
59 + function TUTOR_BP() {
60 + $info = array(
61 + 'path' => plugin_dir_path( TUTOR_BP_FILE ),
62 + 'url' => plugin_dir_url( TUTOR_BP_FILE ),
63 + 'basename' => plugin_basename( TUTOR_BP_FILE ),
64 + 'version' => TUTOR_BP_VERSION,
65 + 'nonce_action' => 'nonce_action',
66 + 'nonce' => '_wpnonce',
67 + );
68 +
69 + return (object) $info;
70 + }
71 + }
72 +
73 + require 'classes/init.php';
74 + new \TUTOR_BP\Init();
75 +