settings = LSD_Options::settings(); } public function form($data = []) { // Disabled in Lite if ($this->isLite() && $this->pro()) return '
' . $this->missFeatureMessage(esc_html($this->label)) . '
'; // Third Party Fields ob_start(); do_action('lsd_element_form_options', $this->key, $data); $additional = LSD_Kses::form(ob_get_clean()); // Title Settings $title = $this->title_settings($data); // General Settings $general = $this->general_settings($data); // Has General Options $has_general_options = trim($general) || trim($additional); // Has Options $has_options = $has_general_options || trim($title); return '
' . $this->label . '
' . ($has_options ? ' ' : '') . '
' . ($has_general_options ? '' : '') . ' ' . (trim($title) ? '
' . $title . '
' : '') . ' ' . ($has_general_options ? '
' . $general . ' ' . $additional . '
' : '') . '
'; } private function title_settings(array $data): string { // No Title Settings if (!$this->has_title_settings) return ''; // Show Title $show_title = isset($data['show_title']) && $data['show_title'] == 1; // Title Alignment $title_alignment = ''; if (!$this->inline_title) { $title_alignment .= '
'; } return '
' . $title_alignment . '

' . esc_html__('If a custom title is provided, it will replace the default title.', 'listdom') . '

'; } protected function general_settings(array $data): string { return ''; } /** * @param LSD_Entity_Listing $listing */ public function set_listing(LSD_Entity_Listing $listing) { $this->listing = $listing; } /** * @param $key * @return mixed */ public static function instance($key) { $element = 'LSD_Element_' . ucfirst($key); // Element Not Found! if (!class_exists($element)) return apply_filters('lsd_addon_elements', false, $key); return new $element(); } public function pro(): bool { return $this->pro_needed; } /** * @param string $content * @param LSD_Element $element * @param array $args * @return mixed|void */ final protected function content($content, $element, $args = []) { // Hook Name $hook = strtolower(get_called_class()) . '_content'; // e.g. lsd_element_address_content // Filter the Results return apply_filters($hook, $content, $element, $args); } }