Changeset 1785859
- Timestamp:
- 12/13/2017 01:44:25 AM (8 years ago)
- Location:
- fareharbor/trunk
- Files:
-
- 2 edited
-
fareharbor.php (modified) (31 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fareharbor/trunk/fareharbor.php
r1655387 r1785859 4 4 Plugin URI: https://fareharbor.com/help/setup/wordpress-plugin/ 5 5 Description: Easily add FareHarbor reservation calendars and buttons to your site 6 Version: 3. 46 Version: 3.5 7 7 Author: FareHarbor 8 8 Author URI: https://fareharbor.com … … 44 44 private function __construct() {} 45 45 46 public static $version = '3. 4';46 public static $version = '3.5'; 47 47 48 48 // Update the saved version number in the wp_options table … … 115 115 update_option( 'fareharbor_kit_version', 'v2' ); 116 116 } 117 elseif ( version_compare( $from, '3.4', '< =' ) ) {117 elseif ( version_compare( $from, '3.4', '<' ) ) { 118 118 // Can't swap version of old sites that might already be using v1 119 119 // of the stylesheet! … … 192 192 $bookembed_defaults; 193 193 194 public static function _clear_options() { 195 // This method exists for testing only. 196 self::$options = null; 197 self::$shared_defaults = null; 198 self::$lightframe_defaults = null; 199 self::$calendar_defaults = null; 200 self::$partners_defaults = null; 201 self::$itemgrid_defaults = null; 202 self::$bookembed_defaults = null; 203 } 204 194 205 private static function init_defaults() { 195 206 … … 208 219 'sheet' => self::get_option( 'fh_default_sheet', '' ), 209 220 'fallback' => self::get_option( 'fh_default_fallback', '' ), 221 'flow' => '', 210 222 211 223 ); … … 287 299 288 300 if ( $args[ 'view_availability' ] && !$args[ 'view_item' ] ) 289 return array( 'error' => 'view_availability but no view_item' ); 301 return array( 'error' => 'view_availability but no view_item' ); 290 302 291 303 $fallback_url = self::lightframe_fallback_url( $args ); … … 338 350 } 339 351 340 $query = self::get_shared_args_array( $args, 'dash', $is_simple_fallback, false );352 $query = self::get_shared_args_array( $args, 'dash', $is_simple_fallback, false, true ); 341 353 342 354 if ( $is_simple_fallback && $args[ 'items' ] ) … … 392 404 393 405 // Modifiers: shared args like fallback, asn, asn_ref, etc. 394 $lo += self::get_shared_args_array( $args, 'camel', true, true );406 $lo += self::get_shared_args_array( $args, 'camel', true, true, true ); 395 407 396 408 return $lo; … … 450 462 if ( isset( $args[ 'error' ] ) ) 451 463 return $args; 452 464 453 465 $type = $args[ 'type' ]; 454 466 if ( $type === 'small' ) … … 461 473 $url_suffix = 'items/' . $args[ 'items' ] . '/'; 462 474 463 return self::embed_script_src( $type, $args, $url_suffix, array(), false );475 return self::embed_script_src( $type, $args, $url_suffix, array(), false, true ); 464 476 465 477 } … … 492 504 $query[ 'include' ] = $args[ 'include' ]; 493 505 494 return self::embed_script_src( 'partners', $args, '', $query, true );506 return self::embed_script_src( 'partners', $args, '', $query, true, false ); 495 507 496 508 } … … 524 536 $query[ 'selected-items' ] = $args[ 'items' ]; 525 537 526 return self::embed_script_src( 'items', $args, '', $query, true );538 return self::embed_script_src( 'items', $args, '', $query, true, true ); 527 539 528 540 } … … 559 571 560 572 // Confirm there's a shortname. All of our shortcodes require this 561 if ( !$args[ 'shortname' ] ) 573 if ( !$args[ 'shortname' ] ) 562 574 return array( 'error' => 'no shortname' ); 563 575 … … 633 645 // ----------------------------------------------- 634 646 635 private static function embed_script_src( $type, $args, $url_suffix, $query, $include_full_items ) {647 private static function embed_script_src( $type, $args, $url_suffix, $query, $include_full_items, $include_flow ) { 636 648 637 649 $script_src = 'https://' . self::url() . '/embeds/script/' … … 646 658 $query += array( 'lightframe' => $args[ 'lightframe' ] ); 647 659 648 $query += self::get_shared_args_array( $args, 'dash', $include_full_items, true );660 $query += self::get_shared_args_array( $args, 'dash', $include_full_items, true, $include_flow ); 649 661 650 662 $query_string = http_build_query( $query ); … … 658 670 // ----------------------------------------------- 659 671 660 private static function get_shared_args_array( $args, $casing, $include_full_items, $include_fallback ) {672 private static function get_shared_args_array( $args, $casing, $include_full_items, $include_fallback, $include_flow ) { 661 673 662 674 $out = array(); … … 682 694 if ( $args[ 'sheet' ] ) 683 695 $out[ 'sheet' ] = $args[ 'sheet' ]; 696 697 if ( $include_flow && $args[ 'flow' ] ) 698 $out[ 'flow' ] = $args[ 'flow' ]; 684 699 685 700 return self::fix_array_key_casing( $out, $casing ); … … 822 837 ); 823 838 824 add_settings_field( 839 add_settings_field( 825 840 'fh_default_shortname', 826 841 'shortname', … … 834 849 ); 835 850 836 add_settings_field( 851 add_settings_field( 837 852 'fh_responsive_calendars', 838 853 'Responsive Calendars', … … 848 863 ); 849 864 850 add_settings_field( 865 add_settings_field( 851 866 'fh_default_fallback', 852 867 'fallback', … … 864 879 ); 865 880 866 add_settings_field( 881 add_settings_field( 867 882 'fh_default_asn', 868 883 'asn', … … 888 903 ); 889 904 890 add_settings_field( 905 add_settings_field( 891 906 'fh_default_ref', 892 907 'ref', … … 900 915 ); 901 916 902 add_settings_field( 917 add_settings_field( 903 918 'fh_default_sheet', 904 919 'sheet', … … 912 927 ); 913 928 914 add_settings_field( 929 add_settings_field( 915 930 'fh_default_full_items', 916 931 'full_items', … … 928 943 ); 929 944 930 add_settings_field( 945 add_settings_field( 931 946 'fh_default_lightframe', 932 947 'lightframe', … … 944 959 ); 945 960 946 add_settings_field( 961 add_settings_field( 947 962 'fh_default_class', 948 963 'class', … … 977 992 978 993 add_settings_section( 979 'fh_buttons_section', 994 'fh_buttons_section', 980 995 'FareHarbor Buttons', 981 996 array( __CLASS__, 'render_fh_buttons_section_text' ), … … 983 998 ); 984 999 985 add_settings_field( 1000 add_settings_field( 986 1001 'fh_buttons_active', 987 1002 'FH Buttons Activation', … … 996 1011 ); 997 1012 998 add_settings_field( 999 'fh_buttons_query', 1013 add_settings_field( 1014 'fh_buttons_query', 1000 1015 'Button Colors', 1001 array( __CLASS__, 'render_input_field' ), 1016 array( __CLASS__, 'render_input_field' ), 1002 1017 __FILE__, 1003 1018 'fh_buttons_section', … … 1027 1042 1028 1043 public static function render_options_page() { 1029 1044 1030 1045 ?> 1031 1046 … … 1043 1058 <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes' ); ?>" /> 1044 1059 </p> 1045 1060 1046 1061 </form> 1047 1062 -
fareharbor/trunk/readme.txt
r1655387 r1785859 3 3 Tags: reservations, booking calendar, booking, reservation plugin, reservation calendar, booking system 4 4 Requires at least: 3.0 5 Tested up to: 4. 7.35 Tested up to: 4.9.1 6 6 Stable tag: trunk 7 7 License: GPLv2 or later … … 43 43 44 44 == Changelog == 45 46 = 3.5 = 47 * Add support for Booking Flows via `flow` shortcode option 45 48 46 49 = 3.4 =
Note: See TracChangeset
for help on using the changeset viewer.