Plugin Directory

Changeset 1398764


Ignore:
Timestamp:
04/19/2016 01:57:39 AM (10 years ago)
Author:
fareharbor
Message:

Add 'responsive' option to [fareharbor] shortcode

Location:
fareharbor/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fareharbor/trunk/fareharbor.php

    r1398596 r1398764  
    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.0
     6    Version: 3.0.1
    77    Author: FareHarbor
    88    Author URI: https://fareharbor.com
     
    4343
    4444
     45  // Add init hook
     46  // -----------------------------------------------
     47
     48  add_action( 'init', array( 'fareharbor', 'init' ) );
     49
    4550  // Global functions for potential backwards compatability
    4651  // -----------------------------------------------
     
    6772    private function __construct() {}
    6873
     74    public static $version = '3.0.1';
     75
     76    // Update the saved version number in the wp_options table
     77    // ===============================================
     78
     79    public static function init() {
     80
     81      if ( is_admin() && ( !defined( 'DOING_AJAX' ) || !DOING_AJAX ) )
     82        update_option( 'fareharbor_version', self::$version );
     83
     84    }
    6985
    7086    // Script source
     
    151167      self::$bookembed_defaults[ 'fallback' ] = '';
    152168
    153       self::$calendar_defaults = array(
    154 
    155         'type' => 'calendar-small',
    156 
    157       );
     169      self::$calendar_defaults = array();
     170
     171      if ( self::get_option( 'fh_responsive_calendars', false ) )
     172        self::$calendar_defaults[ 'type' ] = 'calendar';
     173      else
     174        self::$calendar_defaults[ 'type' ] = 'calendar-small';
    158175
    159176      self::$partners_defaults = array(
     
    380397      if ( $type === 'small' )
    381398        $type = 'calendar-small';
    382       elseif ( $type === 'large' )
     399      elseif ( $type === 'large' || $type === 'responsive' )
    383400        $type = 'calendar';
    384401
     
    761778
    762779      add_settings_field(
     780        'fh_responsive_calendars',
     781        'Responsive Calendars',
     782        array( __CLASS__, 'render_input_field' ),
     783        __FILE__,
     784        'fh_shortcode_defaults_section',
     785        array(
     786          'option_name' => 'fh_responsive_calendars',
     787          'type' => 'checkbox',
     788          'label' => 'Use responsive calendars by default.',
     789          'description' => 'This is the same as [fareharbor type="responsive"].',
     790        )
     791      );
     792
     793      add_settings_field(
    763794        'fh_default_fallback',
    764795        'fallback',
  • fareharbor/trunk/readme.txt

    r1398596 r1398764  
    4444== Changelog ==
    4545
     46= 3.0.1 =
     47* Add type="responsive" option to [fareharbor] shortcode
     48
    4649= 3.0 =
    4750* Add support for [itemgrid] shortcode
Note: See TracChangeset for help on using the changeset viewer.