Exemplo n.º 1
0
/**
 * Description here.
 *
 */
function dt_stylesheet_maybe_web_font($font)
{
    $websafe_fonts = array_keys(dt_stylesheet_get_websafe_fonts());
    return !in_array($font, $websafe_fonts);
}
Exemplo n.º 2
0
// Divider
$divider_html = '<div class="divider"></div>';
$backgrounds_set_1 = dt_get_images_in('images/backgrounds/patterns', 'images/backgrounds', trailingslashit(get_template_directory()));
// here we get presets images
$presets_images = dt_get_images_in('inc/presets/images', 'inc/presets/images', trailingslashit(get_template_directory()));
$id_based_presets_images = array('backgrounds_bottom_bar_bg_image' => array(), 'backgrounds_footer_bg_image' => array(), 'backgrounds_general_bg_image' => array(), 'backgrounds_general_title_bg_image' => array(), 'backgrounds_general_boxed_bg_image' => array(), 'backgrounds_header_bg_image' => array(), 'backgrounds_header_transparent_bg_image' => array(), 'backgrounds_sidebar_bg_image' => array(), 'backgrounds_slideshow_bg_image' => array(), 'backgrounds_background_img' => array(), 'backgrounds_top_bar_bg_image' => array(), 'backgrounds_stripes_stripe_1_bg_image' => array(), 'backgrounds_stripes_stripe_2_bg_image' => array(), 'backgrounds_stripes_stripe_3_bg_image' => array());
// convert all
if ($presets_images) {
    foreach ($presets_images as $full => $thumb) {
        $img_field_id = explode('.', $full);
        // ignore
        if (count($img_field_id) < 3) {
            continue;
        }
        $img_field_id = $img_field_id[1];
        $clear_key = 'backgrounds_' . str_replace('-', '_', $img_field_id);
        if (!isset($id_based_presets_images[$clear_key])) {
            continue;
        }
        $id_based_presets_images[$clear_key][$full] = $thumb;
    }
}
// merge all
foreach ($id_based_presets_images as $field => $value) {
    $id_based_presets_images[$field] = array_merge($value, $backgrounds_set_1);
}
// extract all
extract($id_based_presets_images);
$google_fonts = dt_get_google_fonts_list();
$web_fonts = dt_stylesheet_get_websafe_fonts();
$merged_fonts = array_merge($web_fonts, $google_fonts);