PluginProbe
Vimeography: Vimeo Video Gallery WordPress Plugin / 2.2
Vimeography: Vimeo Video Gallery WordPress Plugin v2.2
2.4.9 2.4.8 trunk 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 0.6 0.6.1 0.6.2 0.6.3 0.6.4 0.6.5 0.6.6 0.6.7 0.6.8 0.6.8.1 0.6.9 0.6.9.1 0.6.9.2 0.7 0.8 All 103 releases
vimeography / lib / admin / welcome.php

welcome.php in Vimeography: Vimeo Video Gallery WordPress Plugin 2.2, at lib/admin/welcome.php

51 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly
4 if ( ! defined( 'ABSPATH' ) ) exit;
5
6 class Vimeography_Admin_Welcome {
7
8 public function __construct() {
9
10 register_activation_hook( VIMEOGRAPHY_BASENAME, array($this, 'set_welcome_screen_flag') );
11
12 add_action( 'admin_init', array($this, 'welcome_screen_do_activation_redirect') );
13
14 }
15
16
17 /**
18 * Set a transient that expires in 30 seconds.
19 *
20 * @return [type] [description]
21 */
22 public function set_welcome_screen_flag() {
23 set_transient( '_vimeography_welcome_screen_activation_redirect', true, 30 );
24 }
25
26
27 /**
28 * Check to see if we should perform the redirect
29 *
30 * @return [type] [description]
31 */
32 public function welcome_screen_do_activation_redirect() {
33
34 // Bail if no activation redirect
35 if ( ! get_transient( '_vimeography_welcome_screen_activation_redirect' ) ) {
36 return;
37 }
38
39 // Delete the redirect transient
40 delete_transient( '_vimeography_welcome_screen_activation_redirect' );
41
42 // Bail if activating from network, or bulk
43 if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
44 return;
45 }
46
47 // Redirect
48 wp_safe_redirect( add_query_arg( array( 'page' => 'vimeography-welcome', 'step' => '1' ), admin_url( 'options.php' ) ) );
49 }
50
51 }