register_contents(); $this->register_styles(); } protected function register_contents(): void { $this->start_controls_section( 'section_content', [ 'label' => esc_html__( 'Social Info', 'addonskit-for-elementor' ), ] ); $this->add_control( 'important_note', [ 'type' => Controls_Manager::RAW_HTML, 'raw' => '
'. esc_html__( 'This widget will show the listing social icons.', 'addonskit-for-elementor' ) . '
', ] ); $this->add_responsive_control( 'action_type_align', [ 'label' => esc_html__( 'Alignment', 'addonskit-for-elementor' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'addonskit-for-elementor' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'addonskit-for-elementor' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'addonskit-for-elementor' ), 'icon' => 'eicon-text-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .directorist-social-links' => 'justify-content: {{VALUE}};', ], 'default' => '', ] ); $this->end_controls_section(); } protected function register_styles(): void { $this->register_icon_style(); } public function render(): void { if ( Helper::is_edit() ) { $social = get_post_meta( get_the_ID(), '_social', true ); if ( empty( $social ) ) { printf( wp_kses( '', [ 'div' => ['class' => [], 'role' => []], 'span' => ['class' => []] ] ), esc_html__( 'Nothing to found!', 'addonskit-for-elementor' ), esc_html__( 'There is no social item in the current listing.', 'addonskit-for-elementor' ) ); } } DirectoristHelper::get_single_listing_fields( 'social_info' ); } }