Changeset 1791467
- Timestamp:
- 12/22/2017 06:08:57 PM (8 years ago)
- Location:
- track-connect/trunk
- Files:
-
- 3 edited
-
includes/views/archive-listing.php (modified) (2 diffs)
-
plugin.php (modified) (11 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
track-connect/trunk/includes/views/archive-listing.php
r1723416 r1791467 12 12 $checkin = (isset($_REQUEST['checkin'])) ? $_REQUEST['checkin'] : false; 13 13 $checkout = (isset($_REQUEST['checkout'])) ? $_REQUEST['checkout'] : false; 14 $bedrooms = (isset($_REQUEST['bedrooms'])) ? $_REQUEST['bedrooms'] : false;14 $bedrooms = (isset($_REQUEST['bedrooms'])) ? $_REQUEST['bedrooms'] : null; 15 15 $lowRate = (isset($_REQUEST['low'])) ? $_REQUEST['low'] : 0; 16 16 $highRate = (isset($_REQUEST['high'])) ? $_REQUEST['high'] : 0; 17 $lowBed = (isset($_REQUEST['lowbed'])) ? $_REQUEST['lowbed'] : 0;18 $highBed = (isset($_REQUEST['highbed'])) ? $_REQUEST['highbed'] : 0;17 $lowBed = (isset($_REQUEST['lowbed'])) ? $_REQUEST['lowbed'] : null; 18 $highBed = (isset($_REQUEST['highbed'])) ? $_REQUEST['highbed'] : null; 19 19 $sleeps = (isset($_REQUEST['sleeps'])) ? $_REQUEST['sleeps'] : 0; 20 20 $debug = (isset($_REQUEST['track_debug'])) ? $_REQUEST['track_debug'] : 0; … … 303 303 include(track_connect_view_override('archive-listing', 'style.php')); 304 304 305 305 306 include(track_connect_view_override('archive-listing', 'header.php')); 306 307 308 307 309 include(track_connect_view_override('archive-listing', 'body.php')); 310 308 311 get_footer(); 309 312 ?> -
track-connect/trunk/plugin.php
r1725757 r1791467 7 7 Author URI: http://www.trackhs.com 8 8 9 Version: 4.0. 39 Version: 4.0.4 10 10 11 11 License: GNU General Public License v2.0 (or later) … … 19 19 define( 'WP_TRACK_DB_VERSION', '1'); 20 20 define( 'WP_LISTINGS_URL', plugin_dir_url( __FILE__ ) ); 21 define( 'WP_LISTINGS_VERSION', '4.0. 3' );21 define( 'WP_LISTINGS_VERSION', '4.0.4' ); 22 22 23 23 register_activation_hook( __FILE__, 'wp_listings_activation' ); … … 28 28 */ 29 29 function wp_listings_activation() { 30 global $wpdb;31 32 /** Flush rewrite rules */33 if ( ! post_type_exists( 'listing' ) ) {34 wp_listings_init();35 global $_wp_listings, $_wp_listings_taxonomies, $_wp_listings_templates;36 $_wp_listings->create_post_type();37 $_wp_listings_taxonomies->register_taxonomies();38 }39 /** Possibly needed: Error handling - registration fail if folder not created */40 if (!file_exists(WP_LISTINGS_VIEWS_DIR)) {41 wp_mkdir_p(WP_LISTINGS_VIEWS_DIR);42 }43 44 $options_table = $wpdb->prefix."options";45 $track_db_version = $wpdb->get_var("SELECT option_value FROM $options_table WHERE option_name = 'track_db_version'");46 if (empty($track_db_version)) {47 $wpdb->insert($options_table ,48 array(49 'option_name' => "track_db_version" ,50 'option_value' => WP_TRACK_DB_VERSION)51 );52 53 $track_db_version = WP_TRACK_DB_VERSION;54 }30 global $wpdb; 31 32 /** Flush rewrite rules */ 33 if ( ! post_type_exists( 'listing' ) ) { 34 wp_listings_init(); 35 global $_wp_listings, $_wp_listings_taxonomies, $_wp_listings_templates; 36 $_wp_listings->create_post_type(); 37 $_wp_listings_taxonomies->register_taxonomies(); 38 } 39 /** Possibly needed: Error handling - registration fail if folder not created */ 40 if (!file_exists(WP_LISTINGS_VIEWS_DIR)) { 41 wp_mkdir_p(WP_LISTINGS_VIEWS_DIR); 42 } 43 44 $options_table = $wpdb->prefix."options"; 45 $track_db_version = $wpdb->get_var("SELECT option_value FROM $options_table WHERE option_name = 'track_db_version'"); 46 if (empty($track_db_version)) { 47 $wpdb->insert($options_table , 48 array( 49 'option_name' => "track_db_version" , 50 'option_value' => WP_TRACK_DB_VERSION) 51 ); 52 53 $track_db_version = WP_TRACK_DB_VERSION; 54 } 55 55 $migrator = new Migrator($track_db_version, $wpdb); 56 56 $migrator->run(); 57 57 58 flush_rewrite_rules();58 flush_rewrite_rules(); 59 59 } 60 60 … … 67 67 function wp_listings_deactivation() { 68 68 69 flush_rewrite_rules();69 flush_rewrite_rules(); 70 70 } 71 71 … … 80 80 function wp_listings_init() { 81 81 82 global $_wp_listings, $_wp_listings_taxonomies, $_wp_listings_templates;83 84 85 86 /** Load textdomain for translation */87 load_plugin_textdomain( 'wp_listings', false, basename( dirname( __FILE__ ) ) . '/languages/' );88 89 /** Includes */90 require_once( dirname( __FILE__ ) . '/includes/helpers.php' );91 require_once( dirname( __FILE__ ) . '/includes/functions.php' );92 require_once( dirname( __FILE__ ) . '/includes/shortcodes.php' );93 require_once( dirname( __FILE__ ) . '/includes/class-listings.php' );94 require_once( dirname( __FILE__ ) . '/includes/class-taxonomies.php' );95 require_once( dirname( __FILE__ ) . '/includes/class-listing-template.php' );96 require_once( dirname( __FILE__ ) . '/includes/class-listings-search-widget.php' );97 require_once( dirname( __FILE__ ) . '/includes/class-featured-listings-widget.php' );98 99 /** Add theme support for post thumbnails if it does not exist */100 if(!current_theme_supports('post-thumbnails')) {101 add_theme_support( 'post-thumbnails' );102 }103 104 /** Registers and enqueues scripts for single listings */105 add_action('wp_enqueue_scripts', 'add_wp_listings_scripts');106 function add_wp_listings_scripts() {82 global $_wp_listings, $_wp_listings_taxonomies, $_wp_listings_templates; 83 84 85 86 /** Load textdomain for translation */ 87 load_plugin_textdomain( 'wp_listings', false, basename( dirname( __FILE__ ) ) . '/languages/' ); 88 89 /** Includes */ 90 require_once( dirname( __FILE__ ) . '/includes/helpers.php' ); 91 require_once( dirname( __FILE__ ) . '/includes/functions.php' ); 92 require_once( dirname( __FILE__ ) . '/includes/shortcodes.php' ); 93 require_once( dirname( __FILE__ ) . '/includes/class-listings.php' ); 94 require_once( dirname( __FILE__ ) . '/includes/class-taxonomies.php' ); 95 require_once( dirname( __FILE__ ) . '/includes/class-listing-template.php' ); 96 require_once( dirname( __FILE__ ) . '/includes/class-listings-search-widget.php' ); 97 require_once( dirname( __FILE__ ) . '/includes/class-featured-listings-widget.php' ); 98 99 /** Add theme support for post thumbnails if it does not exist */ 100 if(!current_theme_supports('post-thumbnails')) { 101 add_theme_support( 'post-thumbnails' ); 102 } 103 104 /** Registers and enqueues scripts for single listings */ 105 add_action('wp_enqueue_scripts', 'add_wp_listings_scripts'); 106 function add_wp_listings_scripts() { 107 107 108 108 wp_register_style('properticons', '//s3.amazonaws.com/properticons/css/properticons.css', '', null, 'all'); … … 169 169 170 170 171 /** Instantiate */172 $_wp_listings = new WP_Listings;173 $_wp_listings_taxonomies = new WP_Listings_Taxonomies;174 $_wp_listings_templates = new Single_Listing_Template;175 176 add_action( 'widgets_init', 'wp_listings_register_widgets' );171 /** Instantiate */ 172 $_wp_listings = new WP_Listings; 173 $_wp_listings_taxonomies = new WP_Listings_Taxonomies; 174 $_wp_listings_templates = new Single_Listing_Template; 175 176 add_action( 'widgets_init', 'wp_listings_register_widgets' ); 177 177 178 178 } … … 185 185 add_action( 'wp_ajax_quote_request', 'get_quote' ); 186 186 add_action( 'wp_ajax_nopriv_quote_request', 'get_quote' ); 187 188 function get_quote(){ 187 188 function get_quote(){ 189 189 $options = get_option('plugin_wp_listings_settings'); 190 190 $unitId = $_POST['cid']; … … 195 195 require_once( __DIR__ . '/includes/api/request.php' ); 196 196 $request = new plugins\api\pluginApi($options['wp_listings_domain'],$options['wp_listings_token']); 197 $quote = $request->getQuote($unitId,$checkin,$checkout,$persons); 198 199 wp_send_json( $quote );197 $quote = $request->getQuote($unitId,$checkin,$checkout,$persons); 198 199 wp_send_json( $quote ); 200 200 } 201 201 202 202 add_action( 'wp_ajax_sync_units', 'sync_units' ); 203 function sync_units(){ 203 function sync_units(){ 204 204 $options = get_option('plugin_wp_listings_settings'); 205 205 $page = null; … … 210 210 require_once( __DIR__ . '/includes/api/request.php' ); 211 211 $request = new plugins\api\pluginApi($options['wp_listings_domain'],$options['wp_listings_token']); 212 $sync = $request->getUnits($page,$size,$options['wp_listings_complex_node']); 213 214 wp_send_json( $sync );212 $sync = $request->getUnits($page,$size,$options['wp_listings_complex_node']); 213 214 wp_send_json( $sync ); 215 215 } 216 216 217 217 add_action( 'wp_ajax_get_unit_count', 'get_unit_count' ); 218 function get_unit_count(){ 218 function get_unit_count(){ 219 219 $options = get_option('plugin_wp_listings_settings'); 220 220 require_once( __DIR__ . '/includes/api/request.php' ); … … 222 222 $count = $request->getUnitCount(); 223 223 $request->removeActive(); 224 225 wp_send_json( $count );224 225 wp_send_json( $count ); 226 226 } 227 227 228 228 add_action( 'wp_ajax_sync_other', 'sync_other' ); 229 function sync_other(){ 230 $options = get_option('plugin_wp_listings_settings'); 231 require_once( __DIR__ . '/includes/api/request.php' ); 232 $request = new plugins\api\pluginApi($options['wp_listings_domain'],$options['wp_listings_token']); 233 $request->getUnitNodes(); 234 $request->rebuildTaxonomies(); 229 function sync_other(){ 230 $options = get_option('plugin_wp_listings_settings'); 231 require_once( __DIR__ . '/includes/api/request.php' ); 232 $request = new plugins\api\pluginApi($options['wp_listings_domain'],$options['wp_listings_token']); 233 $request->getUnitNodes(); 234 $request->rebuildTaxonomies(); 235 235 if(isset($options['wp_listings_complex_node']) && $options['wp_listings_complex_node'] > 0){ 236 $request->getComplexes($options['wp_listings_complex_node']); 236 $request->getComplexes($options['wp_listings_complex_node']); 237 237 } 238 238 } 239 239 240 240 add_action( 'wp_ajax_sync_complexes', 'sync_complexes' ); 241 function sync_complexes(){ 242 $options = get_option('plugin_wp_listings_settings'); 243 require_once( __DIR__ . '/includes/api/request.php' ); 244 $request = new plugins\api\pluginApi($options['wp_listings_domain'],$options['wp_listings_token']); 245 241 function sync_complexes(){ 242 $options = get_option('plugin_wp_listings_settings'); 243 require_once( __DIR__ . '/includes/api/request.php' ); 244 $request = new plugins\api\pluginApi($options['wp_listings_domain'],$options['wp_listings_token']); 245 246 246 if(isset($options['wp_listings_complex_node']) && $options['wp_listings_complex_node'] > 0){ 247 $request->getComplexes($options['wp_listings_complex_node']); 247 $request->getComplexes($options['wp_listings_complex_node']); 248 248 } 249 249 } … … 256 256 function wp_listings_register_widgets() { 257 257 258 $widgets = array( 'WP_Listings_Featured_Listings_Widget', 'WP_Listings_Search_Widget' );259 260 foreach ( (array) $widgets as $widget ) {261 register_widget( $widget );262 }263 264 } 258 $widgets = array( 'WP_Listings_Featured_Listings_Widget', 'WP_Listings_Search_Widget' ); 259 260 foreach ( (array) $widgets as $widget ) { 261 register_widget( $widget ); 262 } 263 264 } -
track-connect/trunk/readme.txt
r1725757 r1791467 3 3 Tags: trackpm, track sync, track hs, track 4 4 Requires at least: 3.7 5 Tested up to: 4. 86 Stable tag: 4.0. 35 Tested up to: 4.9.1 6 Stable tag: 4.0.4 7 7 8 8 Creates and syncs listing-type posts from TRACK PM, a cloud-based property management system (www.trackhs.com). … … 44 44 45 45 == Changelog == 46 = 4.0.4 = 47 Fixed bedroom filters for studio. 48 46 49 = 4.0.3 = 47 50 Fixed small issues with release.
Note: See TracChangeset
for help on using the changeset viewer.