Skip to content

Commit

Permalink
Onboarding videos (#191)
Browse files Browse the repository at this point in the history
* add onboarding videos

* add videos

* add api call to fetch videos list

* remove videos from config file

* updated version

* fix updating videos list
  • Loading branch information
jamesros161 authored Dec 4, 2023
1 parent 3bdd61d commit f8756c6
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 3 deletions.
2 changes: 1 addition & 1 deletion boldgrid-inspirations.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: BoldGrid Inspirations
* Plugin URI: https://www.boldgrid.com/boldgrid-inspirations/
* Version: 2.8.1
* Version: 2.9.0
* Author: BoldGrid <[email protected]>
* Author URI: https://www.boldgrid.com/
* Description: Find inspiration, customize, and launch! BoldGrid Inspirations includes FREE WordPress themes and is the easiest way to launch a new WordPress site complete with custom content.
Expand Down
3 changes: 3 additions & 0 deletions includes/class-boldgrid-inspirations-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,9 @@ public function update_version_options() {
// Update the recorded previous and current versions in WP options.
update_site_option( 'boldgrid_inspirations_previous_version', $current_version );
update_site_option( 'boldgrid_inspirations_current_version', $live_version );

// Update the Onboarding Videos array.
update_site_option( 'boldgrid_onboarding_videos', Boldgrid_Inspirations::get_onboarding_videos() );
}

/**
Expand Down
28 changes: 28 additions & 0 deletions includes/class-boldgrid-inspirations.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,40 @@ public function boldgrid_activate() {
update_site_option( 'boldgrid_inspirations_activated_version', $plugin_data['Version'] );
update_site_option( 'boldgrid_inspirations_current_version', $plugin_data['Version'] );

// Update the Onboarding Videos array.
update_site_option( 'boldgrid_onboarding_videos', self::get_onboarding_videos() );

require_once BOLDGRID_BASE_DIR . '/includes/class-boldgrid-inspirations-attribution.php';
require_once BOLDGRID_BASE_DIR . '/includes/class-boldgrid-inspirations-attribution-page.php';

Boldgrid_Inspirations_Attribution_Page::on_activate();
}

/**
* Get the Onboarding Videos array.
*
* @since 2.9.0
*
* @return array
*/
public static function get_onboarding_videos() {
$config = Boldgrid_Inspirations_Config::get_format_configs();

$api_call_results = Boldgrid_Inspirations_Api::boldgrid_api_call(
$config['ajax_calls']['get-onboarding-videos']
);

if ( 200 !== $api_call_results->status ) {
return array();
}

if ( isset( $api_call_results->result->data ) ) {
return $api_call_results->result->data;
} else {
return array();
}
}

/**
* Check and retrieve reseller data.
*
Expand Down
3 changes: 3 additions & 0 deletions includes/config/config.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@

// Preview Server.
'get-site-content' => '/wpb-maintenance/get-site-content.php',

// Onboarding.
'get-onboarding-videos' => '/api/onboarding/get-videos',
),
'asset_server' => 'https://wp-assets.boldgrid.com',
'preview_server' => 'https://wp-preview.boldgrid.com',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boldgrid-inspirations",
"version": "2.8.1",
"version": "2.9.0",
"description": "BoldGrid Inspirations WordPress plugin",
"directories": {
"test": "tests"
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: inspiration, customization, build, create, design
Requires at least: 4.4
Tested up to: 6.4
Requires PHP: 5.4
Stable tag: 2.8.1
Stable tag: 2.9.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -35,6 +35,12 @@ The second phase is Customization; tools to transform your website into your vis

== Changelog ==

= 2.9.0 =

Release Date: December 4th, 2023

* New Feature: Added onboarding videos that are fetched from the BoldGrid API Server.

= 2.8.1 =

Release Date: November 8th, 2023
Expand Down

0 comments on commit f8756c6

Please sign in to comment.