static::html_tag_follows_link(), ] ); } protected static function define_props_schema(): array { $props = [ 'classes' => Classes_Prop_Type::make() ->default( [] ), 'image' => Image_Prop_Type::make() ->default_url( Placeholder_Image::get_placeholder_image() ) ->default_size( 'full' ), 'link' => Link_Prop_Type::make(), 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ), ]; return $props; } protected function define_atomic_controls(): array { return [ Section::make() ->set_label( esc_html__( 'Content', 'elementor' ) ) ->set_id( 'content' ) ->set_items( [ Image_Control::bind_to( 'image' ) ->set_label( __( 'Image', 'elementor' ) ), ] ), Section::make() ->set_label( __( 'Settings', 'elementor' ) ) ->set_id( 'settings' ) ->set_items( $this->get_settings_controls() ), ]; } protected function get_settings_controls(): array { return [ Link_Control::bind_to( 'link' ) ->set_placeholder( __( 'Type or paste your URL', 'elementor' ) ) ->set_label( __( 'Link', 'elementor' ) ), Text_Control::bind_to( '_cssid' ) ->set_label( __( 'ID', 'elementor' ) ) ->set_meta( $this->get_css_id_control_meta() ), ]; } protected function define_base_styles(): array { return [ self::LINK_BASE_STYLE_KEY => Style_Definition::make() ->add_variant( Style_Variant::make() ->add_prop( 'all', 'unset' ) ->add_prop( 'display', 'inherit' ) ->add_prop( 'width', 'fit-content' ) ->add_prop( 'cursor', 'pointer' ) ), self::BASE_STYLE_KEY => Style_Definition::make() ->add_variant( Style_Variant::make() ->add_prop( 'display', 'block' ) ), ]; } protected function get_templates(): array { return [ 'elementor/elements/atomic-image' => __DIR__ . '/atomic-image.html.twig', ]; } public function render_markdown(): string { $settings = $this->get_atomic_settings(); $src = $settings['image']['src'] ?? ''; if ( empty( $src ) ) { return ''; } $alt = $settings['image']['alt'] ?? ''; return '![' . $alt . '](' . esc_url( $src ) . ')'; } }