'Fields', 'layouts' => 'Layouts', 'migrator' => 'Migrator', 'admin' => 'Admin', 'workflows' => 'Workflows') as $file => $class) { require_once __DIR__ . '/local/class-' . $file . '.php'; if (!class_exists('CustomFieldsPro\\' . $class, false)) { class_alias('CustomFields\\Local\\' . $class, 'CustomFieldsPro\\' . $class); } } require_once __DIR__ . '/local/functions.php'; foreach (array('Fields', 'Layouts', 'Admin', 'Workflows') as $class) { call_user_func(array('CustomFields\\Local\\' . $class, 'init')); } add_action('plugins_loaded', array(__CLASS__, 'extensions'), 25); } public static function extensions() { foreach (array('content-types' => 'ContentTypes', 'linked-definitions' => 'LinkedDefinitions', 'definition-sync' => 'DefinitionSync', 'value-converter' => 'ValueConverter', 'relationships' => 'Relationships', 'content-store' => 'ContentStore', 'publishing' => 'Publishing', 'builder-connectors' => 'BuilderConnectors') as $file => $class) { $path = __DIR__ . '/class-' . $file . '.php'; if (is_file($path)) { require_once $path; call_user_func(array(__NAMESPACE__ . '\\' . $class, 'boot')); } } } /** Old Pro includes its classes early. Suppress only the bootstrap owned by that plugin file. */ private static function retire_legacy_bootstrap() { if (!defined('CUSTOMFIELDS_PRO_VERSION') || version_compare(CUSTOMFIELDS_PRO_VERSION, '0.5.0-beta.1', '>=') || !defined('CUSTOMFIELDS_PRO_FILE')) { return; } global $wp_filter; $callbacks = isset($wp_filter['plugins_loaded']) ? ($wp_filter['plugins_loaded']->callbacks[15] ?? array()) : array(); foreach ($callbacks as $entry) { if (!($entry['function'] instanceof \Closure)) { continue; } $reflection = new \ReflectionFunction($entry['function']); if (realpath($reflection->getFileName()) === realpath(CUSTOMFIELDS_PRO_FILE)) { remove_action('plugins_loaded', $entry['function'], 15); } } if (class_exists('CustomFieldsPro\\License', false)) { \CustomFieldsPro\License::init(); } add_action('admin_notices', static function () { $screen = get_current_screen(); // This compatibility message belongs on plugin management and our own screens. if (!$screen || ($screen->base !== 'plugins' && ($screen->parent_base ?? '') !== 'customfields')) { return; } if (current_user_can('activate_plugins')) { echo '

' . esc_html__('CustomFields.com Free now provides local editing. Update Pro to the matching release for agency tools; saved content and the licence connection are retained.', 'customfields-com') . '

'; } }); } }