Last active
March 10, 2016 21:33
-
-
Save JeppeSigaard/99649bdeeaccebaff9a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin name: WorPress initial setup | |
Description: Indstiller indstillinger til standardting første gang wordpress initieres | |
*/ | |
add_action( 'init', function(){ | |
if (!get_option('prfx_setup_has_run')) { | |
// Sæt options hér, enkeltvis eller loop gennem en array | |
/* For eksempel */ | |
$options = array( | |
'posts_per_page' => '10', // Antal sider i et arkiv | |
'uploads_use_yearmonth_folders' => 0, // Nej tak, ingen År/måned mapper | |
'blog_public' => 0, // Skjul blog indtil videre | |
'template' => 'Fancy Custom Template', // Brug min egen template | |
); | |
foreach ( $options as $key => $value ) { | |
update_option($key,$value); | |
} | |
/* Slut eksempel */ | |
update_option('prfx_setup_has_run','1'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment