function get_styles() { return K2::files_scan(K2_STYLES_PATH, 'css', 2); }
/** * Adds styles to the list of editable files in the Theme Editor */ function theme_editor_append_styles() { global $wp_themes, $pagenow; $styles_dir = K2Styles::get_styles_dir(); if ('theme-editor.php' == $pagenow and strpos($styles_dir, WP_CONTENT_DIR) !== false) { get_themes(); $current = get_current_theme(); // Get a list of style css $styles = K2::files_scan($styles_dir, 'css', 3); // Loop through each style css and add to the list foreach ($styles as $style_css) { $wp_themes[$current]['Stylesheet Files'][] = "{$styles_dir}/{$style_css}"; } $wp_themes[$current]['Stylesheet Files'][] = "/css/k2.css"; } }
function get_header_images() { global $wpdb; $images = K2::files_scan(K2_HEADERS_DIR, array('gif', 'jpeg', 'jpg', 'png'), 1); $attachment_ids = $wpdb->get_results("SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = 'k2-header-image'", ARRAY_N); if (!empty($attachment_ids)) { foreach ($attachment_ids as $id_array) { $images[] = $id_array[0]; } } return $images; }
function get_header_images() { return K2::files_scan(K2_HEADERS_PATH, array('gif', 'jpeg', 'jpg', 'png'), 1); }