Skip to content

Commit

Permalink
Check if the plugin is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia committed Feb 5, 2025
1 parent f73c622 commit 42d8298
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions includes/classes/Feature/AcfRepeater/AcfRepeater.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace ElasticPress\Feature\AcfRepeater;

use ElasticPress\Feature;
use ElasticPress\FeatureRequirementsStatus;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
Expand Down Expand Up @@ -40,6 +41,22 @@ public function set_i18n_strings(): void {
$this->docs_url = __( 'https://www.elasticpress.io/documentation/article/configuring-elasticpress-via-the-plugin-dashboard/#autosuggest', 'elasticpress' );
}

/**
* Determine WC feature reqs status
*
* @return FeatureRequirementsStatus
*/
public function requirements_status() {
$status = new FeatureRequirementsStatus( 0 );

if ( ! function_exists( 'acf_get_field_groups' ) ) {
$status->code = 2;
$status->message = esc_html__( 'ACF Pro not installed.', 'elasticpress' );
}

return $status;
}

/**
* Setup feature functionality
*/
Expand Down

0 comments on commit 42d8298

Please sign in to comment.