1 | <?php |
||
20 | class Update { |
||
21 | |||
22 | /** |
||
23 | * Previous version. |
||
24 | * |
||
25 | * @access protected |
||
26 | * @var string |
||
27 | */ |
||
28 | private $installed_ver = '0.0.0'; |
||
29 | |||
30 | /** |
||
31 | * Current version. |
||
32 | * |
||
33 | * @access private |
||
34 | * @var string |
||
35 | */ |
||
36 | private $new_ver = '0.0.0'; |
||
37 | |||
38 | /** |
||
39 | * Existing posts. |
||
40 | * |
||
41 | * @access private |
||
42 | * @var array |
||
43 | */ |
||
44 | private $posts = array(); |
||
45 | |||
46 | /** |
||
47 | * Update path. |
||
48 | * |
||
49 | * @access private |
||
50 | * |
||
51 | * @var array |
||
52 | */ |
||
53 | private $update_path = array( |
||
54 | '2.1.0', |
||
55 | '2.2.0', |
||
56 | '3.0.0', |
||
57 | ); |
||
58 | |||
59 | /** |
||
60 | * Constructor. |
||
61 | * |
||
62 | * @since 3.0.0 |
||
63 | * |
||
64 | * @param string $version (optional) Current plugin version, defaults to value in plugin constant. |
||
65 | */ |
||
66 | public function __construct( $version = SIMPLE_CALENDAR_VERSION ) { |
||
76 | |||
77 | /** |
||
78 | * Update to current version. |
||
79 | * |
||
80 | * Runs all the update scripts through version steps. |
||
81 | * |
||
82 | * @since 3.0.0 |
||
83 | */ |
||
84 | public function run_updates() { |
||
135 | |||
136 | /** |
||
137 | * Handle redirects to welcome page after install and updates. |
||
138 | * |
||
139 | * Transient must be present, the user must have access rights, and we must ignore the network/bulk plugin updaters. |
||
140 | * |
||
141 | * @since 3.0.0 |
||
142 | */ |
||
143 | public function admin_redirects() { |
||
166 | |||
167 | /** |
||
168 | * Get posts. |
||
169 | * |
||
170 | * @since 3.0.0 |
||
171 | * |
||
172 | * @param $post_type |
||
173 | * |
||
174 | * @return array |
||
175 | */ |
||
176 | private function get_posts( $post_type ) { |
||
201 | |||
202 | /** |
||
203 | * Update. |
||
204 | * |
||
205 | * Runs an update script for the specified version passed in argument. |
||
206 | * |
||
207 | * @since 3.0.0 |
||
208 | * |
||
209 | * @param string $version |
||
210 | */ |
||
211 | private function update( $version ) { |
||
219 | |||
220 | } |
||
221 |