PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.0-beta3
Elementor Website Builder – more than just a page builder v4.3.0-beta3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / modules / mcp / abilities / interactions-schema-resource-ability.php

interactions-schema-resource-ability.php in Elementor Website Builder – more than just a page builder 4.3.0-beta3, at modules/mcp/abilities/interactions-schema-resource-ability.php

42 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\Mcp\Abilities;
4
5 use Elementor\Modules\Interactions\Props\Interaction_Item_Prop_Type;
6 use Elementor\Modules\Mcp\Abilities\Utils\Widget_Context_Helper;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 class Interactions_Schema_Resource_Ability extends Abstract_Ability {
13 const URI = 'elementor://interactions/schema';
14
15 protected function get_ability_id(): string {
16 return 'elementor/interactions-schema-resource';
17 }
18
19 protected function get_definition(): Ability_Definition {
20 return new Ability_Definition(
21 __( 'Interactions Schema', 'elementor' ),
22 __( 'Native interaction item schema: shape, allowed enums, and defaults for build-composition.', 'elementor' ),
23 'elementor',
24 [ 'type' => 'string' ],
25 [
26 'mcp' => [
27 'type' => 'resource',
28 'uri' => self::URI,
29 'public' => true,
30 'mimeType' => 'application/json',
31 'description' => __( 'Interaction item shape, enums, and defaults for build-composition.', 'elementor' ),
32 ],
33 ],
34 fn() => current_user_can( 'edit_posts' )
35 );
36 }
37
38 public function execute( $input = [] ) {
39 return wp_json_encode( Widget_Context_Helper::to_plain_llm_schema( Interaction_Item_Prop_Type::make() ) );
40 }
41 }
42