PluginProbe
Powerkit – Supercharge your WordPress Site / 2.4.4
Powerkit – Supercharge your WordPress Site v2.4.4
3.1.1 3.1.0 3.0.9 3.0.8 trunk 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 All 87 releases
powerkit / core / class-powerkit-deprecated.php

class-powerkit-deprecated.php in Powerkit – Supercharge your WordPress Site 2.4.4, at core/class-powerkit-deprecated.php

79 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Deprecated features and migration functions
4 *
5 * @package Powerkit
6 * @subpackage Core
7 */
8
9 /**
10 * Migration to 2.0.7
11 *
12 * @param string $current Current version.
13 * @param string $new New version.
14 */
15 add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
16 /* Migration to 2.0.7 */
17 if ( version_compare( $current, '2.0.7', '<' ) ) {
18 require_once POWERKIT_PATH . 'modules/post-views/helpers/db-powerkit-post-views.php';
19
20 $post_views_db = new Powerkit_Post_Views_DB();
21
22 $post_views_db->activate_single();
23 }
24 }, 10, 2 );
25
26 /**
27 * Migration to 2.2.2
28 *
29 * @param string $current Current version.
30 * @param string $new New version.
31 */
32 add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
33 /* Migration to 2.2.2 */
34 if ( version_compare( $current, '2.2.2', '<' ) ) {
35 $transients = array(
36 'powerkit_connect_instagram_app_access_token',
37 'powerkit_connect_instagram_app_type',
38 'powerkit_connect_instagram_app_user_id',
39 'powerkit_connect_instagram_app_username',
40 'powerkit_connect_instagram_app_refresh',
41 'powerkit_connect_facebook_app_access_token',
42 'powerkit_connect_facebook_app_accounts',
43 'powerkit_connect_facebook_app_refresh',
44 'powerkit_connect_twitter_app_user_id',
45 'powerkit_connect_twitter_app_screen_name',
46 'powerkit_connect_twitter_app_oauth_token',
47 'powerkit_connect_twitter_app_oauth_token_secret',
48 );
49
50 foreach ( $transients as $key => $transient ) {
51 if ( get_transient( $transient ) && ! get_option( $transient ) ) {
52 update_option( $transient, get_transient( $transient ) );
53 }
54 }
55
56 if ( ! wp_next_scheduled( 'event_access_token_refresh' ) ) {
57 wp_schedule_event( time(), 'daily', 'event_access_token_refresh' );
58 }
59 }
60 }, 10, 2 );
61
62 /**
63 * Migration to 2.3.0
64 *
65 * @param string $current Current version.
66 * @param string $new New version.
67 */
68 add_action( 'powerkit_plugin_upgrade', function ( $current, $new ) {
69 /* Migration to 2.3.0 */
70 if ( version_compare( $current, '2.3.0', '<' ) ) {
71 if ( 'before' === get_option( 'powerkit_toc_display', 'none' ) ) {
72 update_option( 'powerkit_toc_enable_automatically', true );
73 }
74 if ( 'after' === get_option( 'powerkit_toc_display', 'none' ) ) {
75 update_option( 'powerkit_toc_enable_automatically', true );
76 }
77 }
78 }, 10, 2 );
79