Skip to content

Instantly share code, notes, and snippets.

@JeppeSigaard
Last active March 10, 2016 21:33
Show Gist options
  • Save JeppeSigaard/99649bdeeaccebaff9a2 to your computer and use it in GitHub Desktop.
Save JeppeSigaard/99649bdeeaccebaff9a2 to your computer and use it in GitHub Desktop.
<?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