Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




make_site_theme [ WordPress Function ]

make_site_theme ( No parameters )
Returns:
  • (unknown)
Defined at:



{@internal Missing Short Description}}

{@internal Missing Long Description}}

Source


<?php
function make_site_theme() {
    
// Name the theme after the blog.
    
$theme_name __get_option('blogname');
    
$template sanitize_title($theme_name);
    
$site_dir WP_CONTENT_DIR "/themes/$template";

    
// If the theme already exists, nothing to do.
    
if ( is_dir($site_dir)) {
        return 
false;
    }

    
// We must be able to write to the themes dir.
    
if (! is_writable(WP_CONTENT_DIR "/themes")) {
        return 
false;
    }

    
umask(0);
    if (! 
mkdir($site_dir0777)) {
        return 
false;
    }

    if (
file_exists(ABSPATH 'wp-layout.css')) {
        if (! 
make_site_theme_from_oldschool($theme_name$template)) {
            
// TODO: rm -rf the site theme directory.
            
return false;
        }
    } else {
        if (! 
make_site_theme_from_default($theme_name$template))
            
// TODO: rm -rf the site theme directory.
            
return false;
    }

    
// Make the new site theme active.
    
$current_template __get_option('template');
    if (
$current_template == WP_DEFAULT_THEME) {
        
update_option('template'$template);
        
update_option('stylesheet'$template);
    }
    return 
$template;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics