PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / 2.3.2
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels v2.3.2
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
← All changes | includes/activator.php +10 -45 1.6.22.3.2 View file →
@@ -26,56 +26,21 @@
26 26 *
27 27 * @since 1.0.0
28 28 */
29 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 - }
30 + // Insert the plugin settings and default values for the first time
31 + $defaults = ayg_get_default_settings();
38 32
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 );
33 + foreach ( $defaults as $option_name => $values ) {
34 + if ( false == get_option( $option_name ) ) {
35 + add_option( $option_name, $values );
36 + }
55 37 }
38 +
39 + // Create a custom database table "{$wpdb->prefix}ayg_videos"
40 + ayg_db_create_videos_table();
56 41
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 42 // Insert the plugin version
78 43 add_option( 'ayg_version', AYG_VERSION );
79 44 }
80 45
81 -}
46 +}