-
Notifications
You must be signed in to change notification settings - Fork 0
/
spiro_wp_settings.php
58 lines (53 loc) · 1.59 KB
/
spiro_wp_settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/*
Plugin Name: Spiro WP Settings
Plugin URI: https://spiro.se
Description: Set some default settings to make a good base
Version: 1.0.2
Author: Jens Hellqvist
Author URI: http://superautomatic.com
*/
/**
* Executed on register_activation
* @hook register_activation_hook
*/
function set_superautomatic_defaults()
{
global $wpdb;
$o = [
'avatar_default' => 'mystery',
'avatar_rating' => 'G',
'category_base' => '',
'comment_max_links' => 2,
'comment_moderation' => 0, // An administrator must always approve the comment
'comment_whitelist' => 0, // Comment author must have a previously approved comment
'comments_notify' => 0,
'comments_per_page' => 0,
'date_format' => 'j F Y',
'default_comment_status_page' => 'closed',
'default_ping_status' => 'open',
'default_pingback_flag' => 0, // Attempt to notify any blogs linked to from the article.
'default_post_edit_rows' => 30,
'embed_size_h' => 1000,
'embed_size_w' => 460,
'links_updated_date_format' => 'j F Y, H:i',
'permalink_structure' => '/%category%/%postname%/',
'rss_language' => 'sv',
'start_of_week' => 1,
'thread_comments' => 0,
'time_format' => 'H:i',
'timezone_string' => 'Europe/Stockholm',
'uploads_use_yearmonth_folders' => 0, // Organize my uploads into month- and year-based folders
'use_smilies' => 0,
];
foreach ( $o as $k => $v )
{
update_option($k, $v);
}
// Delete dummy post and comment.
wp_delete_post(1, TRUE);
wp_delete_comment(1);
// empty blogroll
$wpdb->query("TRUNCATE {$wpdb->links}");
}
register_activation_hook(__FILE__, 'set_superautomatic_defaults');