Jake Vanderwerf
2026-04-15 c4aa5cdb5e90ad4b420e22772797d16980232a2b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php
namespace JVBase\managers\SEO\render\Traits\_Properties;
 
use JVBase\inc\managers\SEO\render\Thing\Action\Action;
use JVBase\managers\SEO\render\Traits\_Helpers\arrayHelper;
 
if (!defined('ABSPATH')) {
    exit;
}
trait potentialActionTrait {
    use arrayHelper;
    /**
     * @var Action|array Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
     */
    protected Action|array $potentialAction;
 
    public function getPotentialAction():Action|array|null
    {
        return $this->potentialAction??null;
    }
    public function setPotentialAction(Action|array $potentialAction):void
    {
        if (is_array($potentialAction)) {
            $potentialAction = $this->classArray('potentialAction', $potentialAction, 'JVBase\inc\managers\SEO\render\Thing\Action\Action');
            $potentialAction = array_map(
                function ($item) {
                    $target = $item->getTarget();
                    $url = $target->getUrlTemplate();
                    $target->setId($url.'#entrypoint');
 
                    return $item;
                },
                $potentialAction
            );
            if (empty($potentialAction)) {
                return;
            }
        }
        $this->potentialAction = $potentialAction;
    }
 
    public function getPotentialActionFieldConfig():array
    {
        return [
            'type'          => 'repeater',
            'label'         => 'Potential Action',
            'fields'        => [
                'type'  => [
                    'type'  => 'select',
                    'label' => 'Action Type',
                    'options'   => [
                        'AchieveAction' => 'Achieve Action',
                        'LoseAction'    => ' - Lose Action',
                        'TieAction' => ' - Tie Action',
                        'WinAction' => ' - Win Action',
                        'AssessAction'  => 'Assess Action',
                        'ChooseAction'  => ' - Choose Action',
                        'IgnoreAction'  => ' - Ignore Action',
                        'ReactAction'   => ' - React Action',
                        'ReviewAction'  => ' - Review Action',
                        'ConsumeAction' => 'Consume Action',
                        'DrinkAction'   => ' - Drink Action',
                        'EatAction' => ' - Eat Action',
                        'InstallAction' => ' - Install Action',
                        'ListenAction'  => ' - Listen Action',
                        'PlayGameAction'    => ' - PlayGame Action',
                        'ReadAction'    => ' - Read Action',
                        'UseAction' => ' - Use Action',
                        'ViewAction'    => ' - View Action',
                        'WatchAction'   => ' - Watch Action',
                        'ControlAction' => 'Control Action',
                        'ActivateAction'    => ' - Activate Action',
                        'AuthenticateAction'    => ' - Authenticate Action',
                        'DeactivateAction'  => ' - Deactivate Action',
                        'LoginAction'   => ' - Login Action',
                        'ResetPasswordAction'   => ' - ResetPassword Action',
                        'ResumeAction'  => ' - Resume Action',
                        'SuspendAction' => ' - Suspend Action',
                        'CreateAction'  => 'Create Action',
                        'CookAction'    => ' - Cook Action',
                        'DrawAction'    => ' - Draw Action',
                        'FilmAction'    => ' - Film Action',
                        'PaintAction'   => ' - Paint Action',
                        'PhotographAction'  => ' - Photograph Action',
                        'WriteAction'   => ' - Write Action',
                        'FindAction'    => 'Find Action',
                        'CheckAction'   => ' - Check Action',
                        'DiscoverAction'    => ' - Discover Action',
                        'TrackAction'   => ' - Track Action',
                        'InteractAction'=> 'Interact Action',
                        'BefriendAction'=> ' - Befriend Action',
                        'CommunicateAction'=> ' - Communicate Action',
                        'Follow Action'=> ' - Follow Action',
                        'JoinAction'=> ' - Join Action',
                        'LeaveAction'=> ' - Leave Action',
                        'MarryAction'=> ' - Marry Action',
                        'RegisterAction'=> ' - Register Action',
                        'SubscribeAction'=> ' - Subscribe Action',
                        'UnRegisterAction'=> ' - Unregister Action',
                        'MoveAction'    => 'Move Action',
                        'ArriveAction'  => ' - Arrive Action',
                        'DepartAction'  => ' - Depart Action',
                        'TravelAction'  => ' - Travel Action',
                        'OrganizeAction'=> 'Organize Action',
                        'AllocateAction'=> ' - Allocate Action',
                        'ApplyAction'=> ' - Apply Action',
                        'BookmarkAction'=> ' - Bookmark Action',
                        'PlanAction'=> ' - Plan Action',
                        'PlayAction'    => 'Play Action',
                        'ExerciseAction'    => ' - Exercise Action',
                        'PerformAction' => ' - Perform Action',
                        'SearchAction'  => 'Search Action',
                        'SeekToAction'  => 'Seek To Action',
                        'TradeAction'   => 'Trade Action',
                        'BuyAction' => ' - Buy Action',
                        'OrderAction'   => ' - Order Action',
                        'PayAction' => ' - Pay Action',
                        'PreOrderAction'    => ' - PreOrder Action',
                        'QuoteAction'   => ' - Quote Action',
                        'RentAction'    => ' - Rent Action',
                        'SellAction'    => ' - Sell Action',
                        'TipAction' => ' - Tip Action',
                        'TransferAction'=> 'Transfer Action',
                        'BorrowAction'=> ' - Borrow Action',
                        'DonateAction'=> ' - Donate Action',
                        'DownloadAction'=> ' - Download Action',
                        'GiveAction'=> ' - Give Action',
                        'LendAction'=> ' - Lend Action',
                        'MoneyAction'=> ' - Money Transfer',
                        'ReceiveAction'=> ' - Receive Action',
                        'ReturnAction'=> ' - Return Action',
                        'SendAction'=> ' - Send Action',
                        'TakeAction'=> ' - Take Action',
                        'UpdateAction'  => 'Update Action',
                        'AddAction' => ' - Add Action',
                        'DeleteAction'  => ' - Delete Action',
                        'ReplaceAction' => ' - Replace Action',
                    ]
                ],
                'name'  => [
                    'type'  => 'text',
                    'label' => 'Name',
                    'required'  => true,
                    'hint' => 'Example: "Search", "Contact Us"'
                ],
                'target'    => [
                    'type'  => 'text',
                    'label' => 'Target',
                    'required'  => true,
                    'hint'  => 'The URL where this action takes place.'
                ],
                'description'   => [
                    'type'  => 'textarea',
                    'label' => 'Description',
                ]
            ]
        ];
    }
}