예제 #1
0
파일: k2.php 프로젝트: 64kbytes/stayinba
 function get_styles()
 {
     return K2::files_scan(K2_STYLES_PATH, 'css', 2);
 }
예제 #2
0
파일: styles.php 프로젝트: Acidburn0zzz/K2
 /**
  * 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";
     }
 }
예제 #3
0
 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;
 }
예제 #4
0
 function get_header_images()
 {
     return K2::files_scan(K2_HEADERS_PATH, array('gif', 'jpeg', 'jpg', 'png'), 1);
 }