Plugin Directory

Changeset 2964274


Ignore:
Timestamp:
09/07/2023 09:51:52 PM (2 years ago)
Author:
vistawp
Message:

Update to version 1.2.0 from GitHub

Location:
vistawp
Files:
2 added
2 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • vistawp/tags/1.2.0/includes/api/get-listing-params.php

    r2924340 r2964274  
    2020    parent::__construct();
    2121
    22     /**
    23      * Maps URL parameters to SimplyRETS API parameters
    24      */
    25     $this->mappings = array(
     22    $this->mappings = self::get_param_list();
     23  }
     24 
     25  /**
     26   * Gets the default query parameters for a listing
     27   *
     28   * @return Array
     29   */
     30  public static function get_param_list() {
     31    return array(
    2632      'offset' => 'offset', // Required for pagination
    2733      'limit' => 'limit', // Required for pagination
     
    6773      'sort' => 'sort',
    6874      'count' => 'count',
     75      'listing_ids' => 'listing_ids',
     76      'mls_area' => 'mls_area',
    6977    );
    7078  }
     79
    7180}
    72 
    73 
    74 
    75 ?>
  • vistawp/tags/1.2.0/includes/functions.php

    r2949654 r2964274  
    77// based on original work from the PHP Laravel framework
    88if (!function_exists('str_contains')) {
    9     function str_contains($haystack, $needle) {
    10         return $needle !== '' && mb_strpos($haystack, $needle) !== false;
    11     }
     9  function str_contains($haystack, $needle) {
     10    return $needle !== '' && mb_strpos($haystack, $needle) !== false;
     11  }
     12}
     13
     14if (!function_exists('vista_prepare_field_value')) {
     15  /**
     16   * Sanitizes and filters a value, preparing it for a received query parameter
     17   *
     18   * @param string $value - Value of the query parameter to be sanitized and filtered
     19   *
     20   * @return Array $value - Array containing the filtered values,
     21   * (e.g., array( '98877034', '98870614', '98886014') as a result of a string input '98877034,98870614,98886014')
     22   */
     23  function vista_prepare_field_value(string $value): array {
     24    $sanitized_value = sanitize_text_field($value);
     25    $value = preg_split(
     26      '/(%2C\+)|(, )|\+|,\s*/',
     27      $sanitized_value,
     28      -1,
     29      PREG_SPLIT_NO_EMPTY
     30    );
     31
     32    return $value;
     33  }
    1234}
    1335
    1436if (!function_exists('vista_plugin_url')) {
    15     /**
    16      * Helper function to construct relative URLs to files in this plugin.
    17      * This function converts a path relative to the plugin root directory to
    18      * a full path, regardless of plugin file renaming.
    19      *
    20      * @param string $path The path to the file, relative to the plugin root directory
    21      */
    22     function vista_plugin_url(string $path): string {
    23         return plugins_url($path,  dirname(__FILE__));
    24     }
     37  /**
     38   * Helper function to construct relative URLs to files in this plugin.
     39   * This function converts a path relative to the plugin root directory to
     40   * a full path, regardless of plugin file renaming.
     41   *
     42   * @param string $path The path to the file, relative to the plugin root directory
     43   */
     44  function vista_plugin_url(string $path): string {
     45    return plugins_url($path,  dirname(__FILE__));
     46  }
    2547}
    26 
    27 
    28  ?>
  • vistawp/tags/1.2.0/includes/listings/single-listing.php

    r2949654 r2964274  
    9494
    9595      }
    96 
    97     }
    98    
    99     $this->try_process_field( 'sqftPrice', NULL );
     96    } else {
     97      $this->try_process_field( 'sqftPrice', NULL );
     98    }
     99
    100100  }
    101101
  • vistawp/tags/1.2.0/readme.txt

    r2961844 r2964274  
    55Requires at least: 4.7 
    66Tested up to: 6.3 
    7 Stable tag: 1.1.2 
     7Stable tag: 1.2.0 
    88Requires PHP: 7.0 
    99License: GPLv2 or later 
  • vistawp/tags/1.2.0/vista.php

    r2961844 r2964274  
    33* Plugin Name: VistaWP
    44* Description: Retrieves and displays real estate listings
    5 * Version: 1.1.2
     5* Version: 1.2.0
    66* Author: VistaWP
    77* Author URI: https://vistawp.com/
     
    6363   */
    6464  private function init_classes(): void {
     65    Listings\Listing_Display_By_Filters::get_instance();
    6566    Listings\Single_Listing_Display::get_instance();
    6667    Listings\Map::get_instance();
     
    100101      require_once 'includes/api/get-params.php';
    101102    }
    102     // Listing filter interface
    103     if ( !interface_exists("\\VSTA\\Listings\\Listing_Filter")) {
    104       require_once 'includes/listings/listing-filter.php';
    105     }
    106103
    107104    // CLASS FILES:
     105    // For displaying multiple listings by filter
     106    if( !class_exists( "\\VSTA\\Listing_Display_By_Filters" ) ) {
     107      require_once 'includes/listings/listing-display-by-filters.php';
     108    }
     109   
    108110    // For displaying single listings
    109111    if ( !class_exists("\\VSTA\\Listings\\Single_Listing_Display") ) {
  • vistawp/trunk/includes/api/get-listing-params.php

    r2924340 r2964274  
    2020    parent::__construct();
    2121
    22     /**
    23      * Maps URL parameters to SimplyRETS API parameters
    24      */
    25     $this->mappings = array(
     22    $this->mappings = self::get_param_list();
     23  }
     24 
     25  /**
     26   * Gets the default query parameters for a listing
     27   *
     28   * @return Array
     29   */
     30  public static function get_param_list() {
     31    return array(
    2632      'offset' => 'offset', // Required for pagination
    2733      'limit' => 'limit', // Required for pagination
     
    6773      'sort' => 'sort',
    6874      'count' => 'count',
     75      'listing_ids' => 'listing_ids',
     76      'mls_area' => 'mls_area',
    6977    );
    7078  }
     79
    7180}
    72 
    73 
    74 
    75 ?>
  • vistawp/trunk/includes/functions.php

    r2949654 r2964274  
    77// based on original work from the PHP Laravel framework
    88if (!function_exists('str_contains')) {
    9     function str_contains($haystack, $needle) {
    10         return $needle !== '' && mb_strpos($haystack, $needle) !== false;
    11     }
     9  function str_contains($haystack, $needle) {
     10    return $needle !== '' && mb_strpos($haystack, $needle) !== false;
     11  }
     12}
     13
     14if (!function_exists('vista_prepare_field_value')) {
     15  /**
     16   * Sanitizes and filters a value, preparing it for a received query parameter
     17   *
     18   * @param string $value - Value of the query parameter to be sanitized and filtered
     19   *
     20   * @return Array $value - Array containing the filtered values,
     21   * (e.g., array( '98877034', '98870614', '98886014') as a result of a string input '98877034,98870614,98886014')
     22   */
     23  function vista_prepare_field_value(string $value): array {
     24    $sanitized_value = sanitize_text_field($value);
     25    $value = preg_split(
     26      '/(%2C\+)|(, )|\+|,\s*/',
     27      $sanitized_value,
     28      -1,
     29      PREG_SPLIT_NO_EMPTY
     30    );
     31
     32    return $value;
     33  }
    1234}
    1335
    1436if (!function_exists('vista_plugin_url')) {
    15     /**
    16      * Helper function to construct relative URLs to files in this plugin.
    17      * This function converts a path relative to the plugin root directory to
    18      * a full path, regardless of plugin file renaming.
    19      *
    20      * @param string $path The path to the file, relative to the plugin root directory
    21      */
    22     function vista_plugin_url(string $path): string {
    23         return plugins_url($path,  dirname(__FILE__));
    24     }
     37  /**
     38   * Helper function to construct relative URLs to files in this plugin.
     39   * This function converts a path relative to the plugin root directory to
     40   * a full path, regardless of plugin file renaming.
     41   *
     42   * @param string $path The path to the file, relative to the plugin root directory
     43   */
     44  function vista_plugin_url(string $path): string {
     45    return plugins_url($path,  dirname(__FILE__));
     46  }
    2547}
    26 
    27 
    28  ?>
  • vistawp/trunk/includes/listings/single-listing.php

    r2949654 r2964274  
    9494
    9595      }
    96 
    97     }
    98    
    99     $this->try_process_field( 'sqftPrice', NULL );
     96    } else {
     97      $this->try_process_field( 'sqftPrice', NULL );
     98    }
     99
    100100  }
    101101
  • vistawp/trunk/readme.txt

    r2961844 r2964274  
    55Requires at least: 4.7 
    66Tested up to: 6.3 
    7 Stable tag: 1.1.2 
     7Stable tag: 1.2.0 
    88Requires PHP: 7.0 
    99License: GPLv2 or later 
  • vistawp/trunk/vista.php

    r2961844 r2964274  
    33* Plugin Name: VistaWP
    44* Description: Retrieves and displays real estate listings
    5 * Version: 1.1.2
     5* Version: 1.2.0
    66* Author: VistaWP
    77* Author URI: https://vistawp.com/
     
    6363   */
    6464  private function init_classes(): void {
     65    Listings\Listing_Display_By_Filters::get_instance();
    6566    Listings\Single_Listing_Display::get_instance();
    6667    Listings\Map::get_instance();
     
    100101      require_once 'includes/api/get-params.php';
    101102    }
    102     // Listing filter interface
    103     if ( !interface_exists("\\VSTA\\Listings\\Listing_Filter")) {
    104       require_once 'includes/listings/listing-filter.php';
    105     }
    106103
    107104    // CLASS FILES:
     105    // For displaying multiple listings by filter
     106    if( !class_exists( "\\VSTA\\Listing_Display_By_Filters" ) ) {
     107      require_once 'includes/listings/listing-display-by-filters.php';
     108    }
     109   
    108110    // For displaying single listings
    109111    if ( !class_exists("\\VSTA\\Listings\\Single_Listing_Display") ) {
Note: See TracChangeset for help on using the changeset viewer.