make_site_theme [ WordPress Function ]
make_site_theme ( No parameters )
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: make_site_theme_from_default, _maybe_update_themes, switch_theme, get_theme, delete_theme
{@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_dir, 0777)) {
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
- Docs for page upgrade.php
make_db_current_silent (line 1714). since: 1.5.0; usedby: install_blog(). void make_db_current_silent ([ $tables = 'all']). $tables. make_site_theme (line 1872) ...
phpdoc.wordpress.org - PHPXRef 0.7 : WordPress : Detail view of upgrade.php
make_site_theme_from_default() make_site_theme() ...
phpxref.ftwr.co.uk - website design - How can I avoid boxes in web page layouts ...
Summing up, it would require a big amount of work to make page not look boxed, so it seems not possible to make site theme/template and ...
graphicdesign.stackexchange.com - switch_theme (WordPress Function) - WPSeek.com
Similar Functions: is_child_theme, wp_get_theme, make_site_theme, get_theme, get_themes. Switches current theme to new template and stylesheet names.
wpseek.com