Sid Gifari File Manager
🏠 Root
/
home
/
ailwtbdh
/
lynchestinegroup.com
/
wp-content
/
themes
/
koncrete
/
inc
/
helper-traits
/
Editing: utility-trait.php
<?php namespace radiustheme\Koncrete; trait UtilityTrait { public static function hex2rgb($hex) { $hex = str_replace("#", "", $hex); if(strlen($hex) == 3) { $r = hexdec(substr($hex,0,1).substr($hex,0,1)); $g = hexdec(substr($hex,1,1).substr($hex,1,1)); $b = hexdec(substr($hex,2,1).substr($hex,2,1)); } else { $r = hexdec(substr($hex,0,2)); $g = hexdec(substr($hex,2,2)); $b = hexdec(substr($hex,4,2)); } $rgb = "$r, $g, $b"; return $rgb; } static function generate_elementor_anchor_attributes($anchor, $classes = '', $include_hrf = true) { if ( ! empty( $anchor['url'] ) ) { $class_attribute = ''; if ( $classes ) { $class_attribute = "class='{$classes}'"; } $target_attribute = ""; if ( $anchor['is_external'] ) { $target_attribute = 'target="_blank"'; } $rel_attribute = ""; if ( $anchor['nofollow'] ) { $rel_attribute = 'rel="nofollow"'; } $href_attributes = ""; if ($include_hrf) { $anchor_url = $anchor['url']; $href_attributes = "href='{$anchor_url}'"; } $all_attributes = "$class_attribute $target_attribute $rel_attribute $href_attributes"; return $all_attributes; } return null; } static function generate_elementor_anchor($anchor, $anchor_text="Read More", $classes='') { if ( $all_attributes = self::generate_elementor_anchor_attributes($anchor, $classes) ) { $a = sprintf( '<%1$s %2$s>%3$s</%1$s>', 'a', $all_attributes, $anchor_text ); return $a; } return null; } }
Save
Cancel