From 52a49a53e817bbee0c86ce182cc65b8bc85548c3 Mon Sep 17 00:00:00 2001 From: Cooper Dalrymple Date: Fri, 1 Aug 2025 10:53:24 -0500 Subject: [PATCH] Allow theme-included ACF Pro as requirement --- includes/abstract-plugin-base.php | 6 +++--- ogre-schema.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/abstract-plugin-base.php b/includes/abstract-plugin-base.php index 4069b92..a0a96bf 100644 --- a/includes/abstract-plugin-base.php +++ b/includes/abstract-plugin-base.php @@ -38,7 +38,7 @@ abstract class PluginBase { add_action('init', [$this, 'setup_textdomain']); // Requirements Check - add_action('plugins_loaded', [$this, 'check_requirements'], 1, 0); + add_action('after_setup_theme', [$this, 'check_requirements'], 1, 0); $this->enable(); } @@ -46,11 +46,11 @@ abstract class PluginBase { // Plugin Initialization protected function enable() { - add_action('plugins_loaded', [$this, 'load'], 10, 0); + add_action('after_setup_theme', [$this, 'load'], 10, 0); add_filter('acf/settings/load_json', [$this, 'register_acf_json'], 10, 1); } protected function disable() { - remove_action('plugins_loaded', [$this, 'load'], 10, 0); + remove_action('after_setup_theme', [$this, 'load'], 10, 0); remove_filter('acf/settings/load_json', [$this, 'register_acf_json'], 10, 1); } diff --git a/ogre-schema.php b/ogre-schema.php index c271176..c320a38 100644 --- a/ogre-schema.php +++ b/ogre-schema.php @@ -36,8 +36,8 @@ class Plugin extends PluginBase { $this->add_requirement('advanced-custom-fields', [ 'name' => 'Advanced Custom Fields PRO', 'url' => 'https://www.advancedcustomfields.com/', - 'type' => self::REQUIREMENT_PLUGIN, - 'plugin' => 'advanced-custom-fields-pro/acf.php', + 'type' => self::REQUIREMENT_CLASS, + 'class' => '\ACF', ]); $this->add_files([