| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Fired during plugin activation |
| 5 |
* |
| 6 |
* @link https://plugins360.com |
| 7 |
* @since 1.0.0 |
| 8 |
* |
| 9 |
* @package Automatic_YouTube_Gallery |
| 10 |
*/ |
| 11 |
|
| 12 |
// Exit if accessed directly |
| 13 |
if ( ! defined( 'WPINC' ) ) { |
| 14 |
die; |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* AYG_Activator class. |
| 19 |
* |
| 20 |
* @since 1.0.0 |
| 21 |
*/ |
| 22 |
class AYG_Activator { |
| 23 |
|
| 24 |
/** |
| 25 |
* Called when the plugin is activated. |
| 26 |
* |
| 27 |
* @since 1.0.0 |
| 28 |
*/ |
| 29 |
public static function activate() { |
| 30 |
// Insert the general settings |
| 31 |
if ( false == get_option( 'ayg_general_settings' ) ) { |
| 32 |
$defaults = array( |
| 33 |
'api_key' => '' |
| 34 |
); |
| 35 |
|
| 36 |
add_option( 'ayg_general_settings', $defaults ); |
| 37 |
} |
| 38 |
|
| 39 |
// Insert the gallery settings |
| 40 |
if ( false == get_option( 'ayg_gallery_settings' ) ) { |
| 41 |
$defaults = array( |
| 42 |
'theme' => 'classic', |
| 43 |
'columns' => 3, |
| 44 |
'per_page' => 12, |
| 45 |
'thumb_ratio' => 56.25, |
| 46 |
'thumb_title' => 1, |
| 47 |
'thumb_title_length' => 0, |
| 48 |
'thumb_excerpt' => 1, |
| 49 |
'thumb_excerpt_length' => 75, |
| 50 |
'pagination' => 1, |
| 51 |
'pagination_type' => 'load_more' |
| 52 |
); |
| 53 |
|
| 54 |
add_option( 'ayg_gallery_settings', $defaults ); |
| 55 |
} |
| 56 |
|
| 57 |
// Insert the player settings |
| 58 |
if ( false == get_option( 'ayg_player_settings' ) ) { |
| 59 |
$defaults = array( |
| 60 |
'player_ratio' => 56.25, |
| 61 |
'player_title' => 1, |
| 62 |
'player_description' => 1, |
| 63 |
'autoplay' => 0, |
| 64 |
'autoadvance' => 0, |
| 65 |
'loop' => 0, |
| 66 |
'controls' => 1, |
| 67 |
'modestbranding' => 1, |
| 68 |
'cc_load_policy' => 0, |
| 69 |
'iv_load_policy' => 0, |
| 70 |
'hl' => '', |
| 71 |
'cc_lang_pref' => '' |
| 72 |
); |
| 73 |
|
| 74 |
add_option( 'ayg_player_settings', $defaults ); |
| 75 |
} |
| 76 |
|
| 77 |
// Insert the plugin version |
| 78 |
add_option( 'ayg_version', AYG_VERSION ); |
| 79 |
} |
| 80 |
|
| 81 |
} |
| 82 |
|