Plugin Directory

Changeset 1655387


Ignore:
Timestamp:
05/11/2017 07:16:27 PM (9 years ago)
Author:
fareharbor
Message:

Support for new version of buttons stylesheet

Location:
fareharbor/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fareharbor/trunk/fareharbor.php

    r1629434 r1655387  
    44    Plugin URI: https://fareharbor.com/help/setup/wordpress-plugin/
    55    Description: Easily add FareHarbor reservation calendars and buttons to your site
    6     Version: 3.3.1
     6    Version: 3.4
    77    Author: FareHarbor
    88    Author URI: https://fareharbor.com
     
    4444    private function __construct() {}
    4545
    46     public static $version = '3.3';
     46    public static $version = '3.4';
    4747
    4848    // Update the saved version number in the wp_options table
     
    111111        );
    112112        update_option( 'fareharbor_settings', $saved_settings + $defaults );
     113
     114        // All new installs from v3.4 on should use v2 of the stylesheet
     115        update_option( 'fareharbor_kit_version', 'v2' );
    113116      }
    114       // elseif ( version_compare( $from, '3.2', '<=' ) ) {
    115         // Preserve old defaults; no action required
    116       // }
     117      elseif ( version_compare( $from, '3.4', '<=' ) ) {
     118        // Can't swap version of old sites that might already be using v1
     119        // of the stylesheet!
     120        update_option( 'fareharbor_kit_version', 'v1' );
     121      }
    117122
    118123      update_option( 'fareharbor_version', self::$version, true );
     
    152157      $query_string = ltrim( $query_string, '?' );
    153158
    154       $fh_kit_src = 'https://fh-kit.com/buttons/v1/';
     159      // Default to v1 for sites that don't have this in the options table in
     160      // case upgrade procedure didn't run.  All new installs should get
     161      // `fareharbor_kit_version` saved as v2 upon install.
     162      $version = get_option( 'fareharbor_kit_version', 'v1' );
     163      // Make the version filterable
     164      $version = apply_filters( 'fareharbor/fh_kit_version', $version );
     165      // Validate.  If we got something funky (as opposed to nothing at all) then
     166      // we'll default to version 2.
     167      if ( !in_array( $version, array( 'v1', 'v2', ), true ) )
     168        $version = 'v2';
     169
     170      $fh_kit_src = "https://fh-kit.com/buttons/$version/";
    155171
    156172      if ( $query_string )
  • fareharbor/trunk/readme.txt

    r1629434 r1655387  
    4343
    4444== Changelog ==
     45
     46= 3.4 =
     47* Upgrade to version 2 of FareHarbor Kit for even better looking buttons with more features
    4548
    4649= 3.3.1 =
  • fareharbor/trunk/uninstall.php

    r1450168 r1655387  
    66  delete_option( 'fareharbor_settings' );
    77  delete_option( 'fareharbor_version' );
     8  delete_option( 'fareharbor_kit_version' );
Note: See TracChangeset for help on using the changeset viewer.