blogs WHERE archived = '0' AND spam = '0' AND deleted = '0'"; return $wpdb->get_col($sql); } /** * Called for a single blog when the plugin is activated. * * Creates the database tables for the plugin. * * @since 4.0.0 */ private static function single_activate() { global $wpdb; $prefix = $wpdb->prefix; $table_name = $prefix . 'slider_pro_sliders'; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); // when the slider is activated for the first time, the tables don't exist, so we need to create them if ( $wpdb->get_var( "SHOW TABLES LIKE '$table_name'" ) != $table_name ) { $create_sliders_table = "CREATE TABLE ". $prefix . "slider_pro_sliders ( id mediumint(9) NOT NULL AUTO_INCREMENT, name varchar(100) NOT NULL, settings text NOT NULL, created varchar(11) NOT NULL, modified varchar(11) NOT NULL, panels_state text NOT NULL, PRIMARY KEY (id) ) DEFAULT CHARSET=utf8;"; $create_slides_table = "CREATE TABLE ". $prefix . "slider_pro_slides ( id mediumint(9) NOT NULL AUTO_INCREMENT, slider_id mediumint(9) NOT NULL, label varchar(100) NOT NULL, position mediumint(9) NOT NULL, visibility varchar(20) NOT NULL, main_image_id mediumint(9) NOT NULL, main_image_source text NOT NULL, main_image_retina_source text NOT NULL, main_image_small_source text NOT NULL, main_image_medium_source text NOT NULL, main_image_large_source text NOT NULL, main_image_retina_small_source text NOT NULL, main_image_retina_medium_source text NOT NULL, main_image_retina_large_source text NOT NULL, main_image_alt text NOT NULL, main_image_title text NOT NULL, main_image_width mediumint(9) NOT NULL, main_image_height mediumint(9) NOT NULL, main_image_link text NOT NULL, main_image_link_title text NOT NULL, thumbnail_source text NOT NULL, thumbnail_retina_source text NOT NULL, thumbnail_alt text NOT NULL, thumbnail_title text NOT NULL, thumbnail_link text NOT NULL, thumbnail_link_title text NOT NULL, thumbnail_content text NOT NULL, caption text NOT NULL, html text NOT NULL, settings text NOT NULL, PRIMARY KEY (id) ) DEFAULT CHARSET=utf8;"; $create_layers_table = "CREATE TABLE ". $prefix . "slider_pro_layers ( id mediumint(9) NOT NULL AUTO_INCREMENT, slider_id mediumint(9) NOT NULL, slide_id mediumint(9) NOT NULL, position mediumint(9) NOT NULL, name text NOT NULL, type text NOT NULL, text text NOT NULL, heading_type varchar(100) NOT NULL, image_source text NOT NULL, image_alt text NOT NULL, image_link text NOT NULL, image_retina text NOT NULL, video_source varchar(20) NOT NULL, video_id varchar(100) NOT NULL, video_poster text NOT NULL, video_retina_poster text NOT NULL, video_load_mode text NOT NULL, video_params text NOT NULL, settings text NOT NULL, PRIMARY KEY (id) ) DEFAULT CHARSET=utf8;"; dbDelta( $create_sliders_table ); dbDelta( $create_slides_table ); dbDelta( $create_layers_table ); update_option( 'sliderpro_version', BQW_SliderPro::VERSION ); } $wpdb->query( "DELETE FROM " . $prefix . "options WHERE option_name LIKE '%sliderpro_cache_%' AND NOT option_name = 'sliderpro_cache_expiry_interval'" ); } /** * Called for a single blog when the plugin is deactivated. * * @since 4.0.0 */ private static function single_deactivate() { } }