| @@ -4,8 +4,9 @@ | ||
| 4 | 4 | namespace Boxzilla\Admin; |
| 5 | 5 | |
| 6 | 6 | class Installer { |
| 7 | 7 | |
| 8 | + | |
| 8 | 9 | /** |
| 9 | 10 | * Run the installer |
| 10 | 11 | */ |
| 11 | 12 | public static function run() { |
| @@ -18,9 +19,9 @@ | ||
| 18 | 19 | */ |
| 19 | 20 | public function install() { |
| 20 | 21 | |
| 21 | 22 | // don't install sample boxes on multisite |
| 22 | - if( is_multisite() ) { | |
| 23 | + if ( is_multisite() ) { | |
| 23 | 24 | return; |
| 24 | 25 | } |
| 25 | 26 | |
| 26 | 27 | $this->transfer_from_stb(); |
| @@ -53,38 +54,38 @@ | ||
| 53 | 54 | |
| 54 | 55 | // only create sample box if no boxes were found |
| 55 | 56 | $boxes = get_posts( |
| 56 | 57 | array( |
| 57 | - 'post_type' => 'boxzilla-box', | |
| 58 | - 'post_status' => array( 'publish', 'draft' ) | |
| 58 | + 'post_type' => 'boxzilla-box', | |
| 59 | + 'post_status' => array( 'publish', 'draft' ), | |
| 59 | 60 | ) |
| 60 | 61 | ); |
| 61 | 62 | |
| 62 | - if( ! empty( $boxes ) ) { | |
| 63 | + if ( ! empty( $boxes ) ) { | |
| 63 | 64 | return false; |
| 64 | 65 | } |
| 65 | 66 | |
| 66 | 67 | $box_id = wp_insert_post( |
| 67 | 68 | array( |
| 68 | - 'post_type' => 'boxzilla-box', | |
| 69 | - 'post_title' => "Sample Box", | |
| 70 | - 'post_content' => "<h4>Hello world.</h4><p>This is a sample box, with some sample content in it.</p>", | |
| 71 | - 'post_status' => 'draft', | |
| 69 | + 'post_type' => 'boxzilla-box', | |
| 70 | + 'post_title' => 'Sample Box', | |
| 71 | + 'post_content' => '<h4>Hello world.</h4><p>This is a sample box, with some sample content in it.</p>', | |
| 72 | + 'post_status' => 'draft', | |
| 72 | 73 | ) |
| 73 | 74 | ); |
| 74 | 75 | |
| 75 | 76 | // set box settings |
| 76 | 77 | $settings = array( |
| 77 | - 'css' => array( | |
| 78 | + 'css' => array( | |
| 78 | 79 | 'background_color' => '#edf9ff', |
| 79 | - 'color' => '', | |
| 80 | - 'width' => '340', | |
| 81 | - 'border_color' => '#dd7575', | |
| 82 | - 'border_width' => '4', | |
| 83 | - 'border_style' => 'dashed', | |
| 84 | - 'position' => 'bottom-right', | |
| 85 | - 'manual' => '' | |
| 86 | - ) | |
| 80 | + 'color' => '', | |
| 81 | + 'width' => '340', | |
| 82 | + 'border_color' => '#dd7575', | |
| 83 | + 'border_width' => '4', | |
| 84 | + 'border_style' => 'dashed', | |
| 85 | + 'position' => 'bottom-right', | |
| 86 | + 'manual' => '', | |
| 87 | + ), | |
| 87 | 88 | ); |
| 88 | 89 | |
| 89 | 90 | update_post_meta( $box_id, 'boxzilla_options', $settings ); |
| 90 | 91 | |
| @@ -89,5 +90,5 @@ | ||
| 89 | 90 | update_post_meta( $box_id, 'boxzilla_options', $settings ); |
| 90 | 91 | |
| 91 | 92 | return true; |
| 92 | 93 | } |
| 93 | -} | |
| 94 | +} | |