/** * Handle any IconAttributes optionally set using the shortcode in combination with the Pro Pack. * * Uses data['sl_map_home_icon'] by default. */ function handleIconAttributes($data_element, $attribute_element) { $this->slplus->debugMP('slp.main', 'pr', get_class() . '::' . __FUNCTION__ . ' Checking attribute[' . $attribute_element . '] with data:', $this->slplus->data); // Check Settings for $attribute_element // if (isset($this->slplus->data[$attribute_element]) && !empty($this->slplus->data[$attribute_element])) { // Start with attribute_element value $icon_url = $this->slplus->data[$attribute_element]; // Prepends value with SLPLUS_ICONURL when it is not a url (could use url_test() ) // Try WordPress is_valid_url() from the common.php library. // if (!$this->slplus->is_valid_url($icon_url)) { $icon_url = SLPLUS_ICONURL . $icon_url; // If file doesn't exist, try to make relative url into absolute url $icon_file = str_replace(SLPLUS_ICONURL, SLPLUS_ICONDIR, $icon_url); if (!file_exists($icon_file)) { $icon_url = get_site_url() . $this->slplus->data[$attribute_element]; } } // Store value found in data_element $this->slplus->data[$data_element] = $icon_url; } }