Skip to content

[FR] Add an Event to register "Compatible Field Types" (to hide the yellow triangle) #13793

Closed Answered by brandonkelly
lindseydiloreto asked this question in Ideas
Discussion options

You must be logged in to vote

Added an event for the next release! (ca9b40a)

use craft\base\Event;
use craft\events\DefineCompatibleFieldTypesEvent;
use craft\services\Fields;

Event::on(
    Fields::class, 
    Fields::EVENT_DEFINE_COMPATIBLE_FIELD_TYPES,
    function (DefineCompatibleFieldTypesEvent $event) {
        if ($event->field instanceof GoogleMapsAddress) {
            $event->compatibleTypes[] = MapboxAddress::class;
        }
    }
);

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@lindseydiloreto
Comment options

@brandonkelly
Comment options

@lindseydiloreto
Comment options

@lindseydiloreto
Comment options

@brandonkelly
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
extensibility 🔌 features related to plugin/module dev
2 participants