Skip to content

Commit

Permalink
Core: Add list of plugin deps
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonascalves committed Apr 14, 2024
1 parent b37b197 commit 904711a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support BuddyPress Community Visibility, "Private Site", feature [#118](https://github.com/renatonascalves/wp-graphql-buddypress/issues/118)
- Add `resendSignupEmail` mutation to resend activation email [#127](https://github.com/renatonascalves/wp-graphql-buddypress/issues/127)
- Added a `CHANGELOG.md` file
- Add list of plugin dependencies [#115](https://github.com/renatonascalves/wp-graphql-buddypress/issues/115)

### Updated

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Requires PHP: 8.0
Requires at least: 5.9
Tested up to: 6.5
Tested up to: 6.5.2
Stable tag: 0.1.1

== Description ==
Expand Down
26 changes: 2 additions & 24 deletions wp-graphql-buddypress.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* Domain Path: /languages/
* Requires PHP: 8.0
* Requires WP: 5.9
* Tested up to: 6.5
* Tested up to: 6.5.2
* Requires Plugins: wp-graphql, buddypress
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down Expand Up @@ -142,12 +143,6 @@ private function setup_constants(): void {
*/
private function includes(): bool {

// Checks if BuddyPress is installed.
if ( ! class_exists( 'BuddyPress' ) ) {
add_action( 'admin_notices', [ $this, 'buddypress_missing_notice' ] );
return false;
}

// Autoload Required Classes.
if ( defined( 'WPGRAPHQL_BUDDYPRESS_AUTOLOAD' ) && false !== WPGRAPHQL_BUDDYPRESS_AUTOLOAD ) {

Expand Down Expand Up @@ -183,27 +178,10 @@ public function wp_graphql_buddypress_missing_notice(): void {
<?php
}

/**
* BuddyPress missing notice.
*/
public function buddypress_missing_notice(): void {

if ( ! current_user_can( 'manage_options' ) ) {
return;
}

?>
<div class="notice notice-error">
<p><strong><?php esc_html_e( 'WPGraphQL BuddyPress', 'wp-graphql-buddypress' ); ?></strong> <?php esc_html_e( 'depends on the lastest version of Buddypress to work!', 'wp-graphql-buddypress' ); ?></p>
</div>
<?php
}

/**
* Sets up actions.
*/
private function actions(): void {

\WPGraphQL\Extensions\BuddyPress\TypeRegistry::add_actions();
}

Expand Down

0 comments on commit 904711a

Please sign in to comment.