Changeset 3341043
- Timestamp:
- 08/07/2025 12:54:46 PM (8 months ago)
- Location:
- supapress/trunk
- Files:
-
- 4 edited
-
composer.json (modified) (1 diff)
-
includes/typesense-functions.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
-
supapress.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
supapress/trunk/composer.json
r3333728 r3341043 3 3 "description": "Quickly and easily connect your book metadata (ONIX) to your WordPress site.", 4 4 "type": "wordpress-plugin", 5 "version": "2.26. 4",5 "version": "2.26.5", 6 6 "authors": [ 7 7 { -
supapress/trunk/includes/typesense-functions.php
r3333728 r3341043 35 35 $publicationDate = $this->get_publication_date(); 36 36 37 if ( isset( $this->properties['show_pubdate'] ) && $this->properties['show_pubdate'] !== 'on' && !empty( $publicationDate ) ) { 37 if ( isset( $this->properties['show_pubdate'] ) && $this->properties['show_pubdate'] !== 'on' ) { 38 return ''; 39 } 40 41 if( !isset( $publicationDate ) ) { 38 42 return ''; 39 43 } … … 135 139 } 136 140 141 if ( empty( $authors ) ) { 142 return ''; 143 } 144 137 145 $authors = $before . implode( $separator, $authors ) . $after; 138 139 if ( empty( $authors ) ) {140 return '';141 }142 146 143 147 if ( $echo ) { … … 261 265 262 266 $args = supapress_ts_search_args( $params, $properties ); 267 268 $orderedIsbns = !empty( $params['isbns'] ) && $params["order"] === 'as-entered' ? explode(',', $params['isbns']) : ""; 269 263 270 $results = supapress_call_typesense( $args ); 264 271 265 return supapress_map_search_ts_data( $results );266 } 267 268 function supapress_map_search_ts_data($results ) {272 return supapress_map_search_ts_data( $results, $orderedIsbns ); 273 } 274 275 function supapress_map_search_ts_data($results, $orderedIsbns = array() ) { 269 276 if( empty( $results["hits"] ) ) { 270 277 return 'Something went wrong'; 278 } 279 280 if (!empty($orderedIsbns)) { 281 $results['hits'] = supapress_reorder_hits_by_isbn($results['hits'], $orderedIsbns); 271 282 } 272 283 … … 279 290 280 291 $result[] = (object) $item['document']; 281 } 292 } 282 293 283 294 if( empty( $result ) ) { … … 288 299 "search" => $result 289 300 ]; 301 } 302 303 function supapress_reorder_hits_by_isbn($hits, $orderedIsbns) { 304 305 if( empty( $hits ) && empty( $orderedIsbns ) ) { 306 return ''; 307 } 308 309 $hitsByIsbn = []; 310 311 foreach ($hits as $hit) { 312 $isbn = $hit['document']['isbn13'] ?? null; 313 if ($isbn) { 314 $hitsByIsbn[$isbn] = $hit; 315 } 316 } 317 318 $reorderedHits = []; 319 foreach ($orderedIsbns as $isbn) { 320 if (isset($hitsByIsbn[$isbn])) { 321 $reorderedHits[] = $hitsByIsbn[$isbn]; 322 } 323 } 324 325 return $reorderedHits; 290 326 } 291 327 -
supapress/trunk/readme.txt
r3333728 r3341043 3 3 Tags: supadü, supadu, folio, books, publishers, supafolio, supadu for wordpress, supapress, supafolio for wordpress 4 4 Requires at least: 6.0 5 Tested up to: 6. 7.26 Stable tag: 2.26. 45 Tested up to: 6.8.2 6 Stable tag: 2.26.5 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 38 38 39 39 == Changelog == 40 41 = 2.26.5 = 42 Release Date: Aug 2025 43 * Change: typesense functions refactored 40 44 41 45 = 2.26.4 = -
supapress/trunk/supapress.php
r3333728 r3341043 7 7 * Plugin URI: https://www.supadu.com 8 8 * Description: Quickly and easily connect your book metadata (ONIX) to your WordPress site. 9 * Version: 2.26. 49 * Version: 2.26.5 10 10 * Author: Supadü 11 11 * Author URI: https://www.supadu.com … … 37 37 defined( 'ABSPATH' ) or die( 'Illegal Access!' ); 38 38 39 define( 'SUPAPRESS_VERSION', '2.26. 4' );39 define( 'SUPAPRESS_VERSION', '2.26.5' ); 40 40 41 41 define( 'SUPAPRESS_SITE_URL', get_site_url() );
Note: See TracChangeset
for help on using the changeset viewer.