-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7557ba6
commit 3b25990
Showing
51 changed files
with
712 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
113 changes: 113 additions & 0 deletions
113
vendor/acrosswp/acrosswp-buddyboss-dependency/acrosswp-buddyboss-dependency.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?php | ||
// Exit if accessed directly | ||
defined( 'ABSPATH' ) || exit; | ||
|
||
class AcrossWP_BuddyBoss_Platform_Dependency extends AcrossWP_Plugins_Dependency { | ||
|
||
/** | ||
* Load this function on plugin load hook | ||
* Example: _e('<strong>BuddyBoss Sorting Option In Network Search</strong></a> requires the BuddyBoss Platform plugin to work. Please <a href="https://buddyboss.com/platform/" target="_blank">install BuddyBoss Platform</a> first.', 'sorting-option-in-network-search-for-buddyboss'); | ||
*/ | ||
function constant_not_define_text(){ | ||
printf( | ||
__( | ||
'<strong>%s</strong></a> requires the BuddyBoss Platform plugin to work. Please <a href="https://buddyboss.com/platform/" target="_blank">install BuddyBoss Platform</a> first.', | ||
'acrosswp' | ||
), | ||
$this->get_plugin_name() | ||
); | ||
} | ||
|
||
/** | ||
* Load this function on plugin load hook | ||
* Example: printf( __('<strong>BuddyBoss Sorting Option In Network Search</strong></a> requires BuddyBoss Platform plugin version %s or higher to work. Please update BuddyBoss Platform.', 'sorting-option-in-network-search-for-buddyboss'), $this->mini_version() ); | ||
*/ | ||
function constant_mini_version_text() { | ||
printf( | ||
__( | ||
'<strong>%s</strong></a> requires BuddyBoss Platform plugin version %s or higher to work. Please update BuddyBoss Platform.', | ||
'acrosswp' | ||
), | ||
$this->get_plugin_name(), | ||
$this->mini_version() | ||
); | ||
} | ||
|
||
/** | ||
* Load this function on plugin load hook | ||
* Example: printf( __('<strong>BuddyBoss Sorting Option In Network Search</strong></a> requires BuddyBoss Platform plugin version %s or higher to work. Please update BuddyBoss Platform.', 'sorting-option-in-network-search-for-buddyboss'), $this->mini_version() ); | ||
*/ | ||
function component_required_text() { | ||
|
||
$bb_components = bp_core_get_components(); | ||
$component_required = $this->component_required(); | ||
$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) ); | ||
$component_required_label = array(); | ||
|
||
foreach( $bb_components as $key => $bb_component ) { | ||
if( in_array( $key, $component_required ) ) { | ||
$component_required_label[] = '<strong>' . $bb_component['title'] . '</strong>'; | ||
} | ||
} | ||
|
||
if( count( $component_required_label ) > 1 ) { | ||
$last = array_pop( $component_required_label ); | ||
$component_required_label = implode( ', ', $component_required_label ) . ' and ' . $last; | ||
} else { | ||
$component_required_label = $component_required_label[0]; | ||
} | ||
|
||
printf( | ||
__( | ||
'<strong>%s</strong></a> requires BuddyBoss Platform %s Component to work. Please Active the mentions Component.', | ||
'acrosswp' | ||
), | ||
$this->get_plugin_name(), | ||
$component_required_label | ||
); | ||
} | ||
|
||
/** | ||
* Load this function on plugin load hook | ||
*/ | ||
function constant_name(){ | ||
return 'BP_PLATFORM_VERSION'; | ||
} | ||
|
||
/** | ||
* Load this function on plugin load hook | ||
*/ | ||
function mini_version(){ | ||
return '2.3.0'; | ||
} | ||
|
||
/** | ||
* Load this function on plugin load hook | ||
*/ | ||
public function component_required() { | ||
return array( 'media' ); | ||
} | ||
|
||
/** | ||
* Check if the Required Component is Active | ||
*/ | ||
public function required_component_is_active() { | ||
$is_active = false; | ||
$component_required = $this->component_required(); | ||
|
||
// Active components. | ||
$active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) ); | ||
|
||
foreach( $component_required as $component_require ) { | ||
if( isset( $active_components[ $component_require ] ) ) { | ||
$is_active = true; | ||
} else { | ||
$is_active = false; | ||
break; | ||
} | ||
} | ||
|
||
return $is_active; | ||
|
||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
vendor/acrosswp/acrosswp-buddyboss-dependency/composer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "acrosswp/acrosswp-buddyboss-dependency", | ||
"type": "library", | ||
"license": "GPL-2.0-or-later", | ||
"description": "Composer to autoload the AcrossWP Dependency Class", | ||
"homepage": "https://acrosswp.com/", | ||
"keywords": [ | ||
"wordpress", | ||
"plugin" | ||
], | ||
"autoload": { | ||
"files": ["acrosswp-buddyboss-dependency.php"] | ||
}, | ||
"support": { | ||
"issues": "https://github.com/acrosswp/acrosswp-buddyboss-dependency/issues" | ||
}, | ||
"require": { | ||
"acrosswp/acrosswp-dependency": "dev-main" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "acrosswp", | ||
"email": "[email protected]" | ||
} | ||
] | ||
} |
Oops, something went wrong.