public function add_font_to_queue($atts) { if (!isset($atts['id']) || !themify_is_google_fonts($atts['id'])) { return ''; } $this->queue[sanitize_title_with_dashes($atts['id'])] = $atts['id']; return ''; }
/** * Get selected custom css google fonts * @return array */ function themify_get_custom_css_gfonts() { $data = themify_get_data(); $fonts = array(); if (is_array($data)) { $new_arr = array(); foreach ($data as $name => $value) { $array = explode('-', $name); $path = ''; foreach ($array as $part) { $path .= "[{$part}]"; } $new_arr[$path] = $value; } $config = themify_convert_brackets_string_to_arrays($new_arr); if (isset($config['styling']) && is_array($config['styling'])) { foreach ($config['styling'] as $ks => $styling) { foreach ($styling as $element => $val) { foreach ($val as $attribute => $v) { switch ($attribute) { case 'font_family': if (!empty($v['value']['value']) && themify_is_google_fonts($v['value']['value'])) { array_push($fonts, $v['value']['value']); } break; } } } } } } return $fonts; }
/** * Get selected custom css google fonts * @return array */ function themify_get_custom_css_gfonts() { $data = themify_get_data(); $fonts = array(); if (is_array($data)) { foreach ($data as $name => $value) { $array = explode('-', $name); $path = ''; foreach ($array as $part) { $path .= "['{$part}']"; } eval("\$config" . $path . " = \$value;"); } if (isset($config['styling']) && is_array($config['styling'])) { foreach ($config['styling'] as $ks => $styling) { foreach ($styling as $element => $val) { foreach ($val as $attribute => $v) { switch ($attribute) { case 'font_family': if (!empty($v['value']['value']) && themify_is_google_fonts($v['value']['value'])) { array_push($fonts, $v['value']['value']); } break; } } } } } } return $fonts; }