Forum Replies Created

Viewing 1 replies (of 1 total)
  • for URL, Image, Media and Gallery controls, you need to extend Elementor\Core\DynamicTags\Data_Tag .
    use this code

    class Custom_Picture_Tag extends \Elementor\Core\DynamicTags\Data_Tag
    {
        public function get_categories()
        {
            return [ \Elementor\Modules\DynamicTags\Module::IMAGE_CATEGORY ];
        }
    
        public function get_group()
        {
            return "additional-data";
        }
    
        public function get_title()
        {
            return "image";
        }
    
        public function get_name()
        {
            return "image";
        }
    
        public function get_value( array $options = array() )
        {
            return [
                    'id' => 1,
                    'url' => wp_get_attachment_image_src(1, 'full')[0],
                ]; 
        }
    }
    
Viewing 1 replies (of 1 total)