control_groups['form'] = [ 'title' => esc_html__( 'Form', 'propertyhive' ), 'tab' => 'content', // content / style ];*/ } public function set_controls() { $this->controls['label'] = [ 'tab' => 'content', //'group' => 'settings', 'label' => esc_html__( 'Label', 'propertyhive' ), 'type' => 'text', 'default' => __( 'Brochure', 'propertyhive' ), ]; } public function render() { global $property; if ( !isset($property->id) ) { return; } $root_classes[] = $this->name; // Add 'class' attribute to element root tag $this->set_attribute( '_root', 'class', $root_classes ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Bricks serializes registered attributes through its documented render_attributes() API. echo "
render_attributes( '_root' )}>"; $label = isset($this->settings['label']) && !empty($this->settings['label']) ? $this->settings['label'] : __( 'Brochure', 'propertyhive' ); if ( get_option('propertyhive_brochures_stored_as', '') == 'urls' ) { $brochure_urls = $property->brochure_urls; if ( !is_array($brochure_urls) ) { $brochure_urls = array(); } if ( !empty($brochure_urls) ) { foreach ( $brochure_urls as $brochure ) { echo '' . esc_html($label) . ''; } } } else { $brochure_attachment_ids = $property->get_brochure_attachment_ids(); if ( !empty($brochure_attachment_ids) ) { foreach ( $brochure_attachment_ids as $attachment_id ) { echo '' . esc_html($label) . ''; } } } echo '
'; } }