Changeset 3377501
- Timestamp:
- 10/13/2025 12:14:39 PM (6 months ago)
- Location:
- ajax-search-lite/trunk
- Files:
-
- 8 edited
-
ajax-search-lite.php (modified) (2 diffs)
-
backend/settings/class/customposttypeseditable.class.php (modified) (1 diff)
-
backend/settings/default_options.php (modified) (1 diff)
-
backend/tabs/instance/layout/results_layout.php (modified) (1 diff)
-
includes/classes/search/class-asl-search-cpt.php (modified) (1 diff)
-
includes/functions/functions.php (modified) (3 diffs)
-
includes/views/asl.shortcode.settings.php (modified) (1 diff)
-
languages/ajax-search-lite.pot (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ajax-search-lite/trunk/ajax-search-lite.php
r3367932 r3377501 4 4 Plugin URI: http://wp-dreams.com 5 5 Description: The lite version of the most powerful ajax powered search engine for WordPress. 6 Version: 4.13. 36 Version: 4.13.4 7 7 Author: Ernest Marcinko 8 8 License: GPLv2 … … 30 30 ); 31 31 define('ASL_URL_NP', str_replace(array( 'http://', 'https://' ), '//', plugin_dir_url(__FILE__))); 32 define('ASL_CURRENT_VERSION', 47 78);33 define('ASL_CURR_VER_STRING', '4.13. 3');32 define('ASL_CURRENT_VERSION', 4780); 33 define('ASL_CURR_VER_STRING', '4.13.4'); 34 34 define('ASL_DEBUG', 0); 35 35 -
ajax-search-lite/trunk/backend/settings/class/customposttypeseditable.class.php
r3349879 r3377501 75 75 <p>Available post types</p><ul id="sortable' . esc_attr(self::$_instancenumber) . '" class="connectedSortable">'; 76 76 foreach ( $this->types as $k => $v ) { 77 if ( !wd_in_array_r($ v, $this->selected) ) {77 if ( !wd_in_array_r($k, $this->selected) ) { 78 78 echo '<li class="ui-state-default ui-left" style="background: #ddd;"> 79 79 <label>' . esc_attr($k) . '</label> -
ajax-search-lite/trunk/backend/settings/default_options.php
r3349879 r3377501 311 311 'close_on_document_click' => 1, 312 312 'show_close_icon' => 1, 313 'post_type_res_title_length' => 999, 313 314 'showauthor' => 0, 314 315 'showdate' => 0, -
ajax-search-lite/trunk/backend/tabs/instance/layout/results_layout.php
r3349879 r3377501 192 192 <div class="item"> 193 193 <?php 194 new wpdreamsTextSmall('post_type_res_title_length', __('Result title length', 'ajax-search-lite'), $sd['post_type_res_title_length']); 195 ?> 196 </div> 197 <div class="item"> 198 <?php 194 199 new wpdreamsYesNo('showauthor', __('Show author in results?', 'ajax-search-lite'), $sd['showauthor']); 195 200 ?> -
ajax-search-lite/trunk/includes/classes/search/class-asl-search-cpt.php
r3349879 r3377501 1378 1378 } 1379 1379 1380 if ( $r->title !== '' && ( MB::strlen( $r->title ) > intval($sd['post_type_res_title_length']) ) ) { 1381 $r->title = wd_substr_at_word($r->title, intval($sd['post_type_res_title_length'])); 1382 } 1383 1380 1384 if ( ! isset( $sd['striptagsexclude'] ) ) { 1381 1385 $sd['striptagsexclude'] = '<a><span>'; -
ajax-search-lite/trunk/includes/functions/functions.php
r3349879 r3377501 3 3 4 4 use WPDRMS\ASL\Utils\Polylang\StringTranslations; 5 use WPDRMS\ASL\Utils\Str; 5 6 6 7 if ( !function_exists('w_isset_def') ) { … … 56 57 if ( !function_exists('wpdreams_parse_params') ) { 57 58 function wpdreams_parse_params( $params ) { 58 foreach ( $params as $k =>$v ) { 59 $_tmp = explode('classname-', $k); 60 if ( $_tmp !== null && count($_tmp) >1 ) { 61 ob_start(); 62 $c = new $v('0', '0', $params[ $_tmp[1] ]); 63 ob_get_clean(); 64 $params[ 'selected-' . $_tmp[1] ] = $c->getSelected(); 65 } 66 $_tmp = null; 67 $_tmp = explode('wpdfont-', $k); 68 if ( $_tmp !== null && count($_tmp) >1 ) { 69 ob_start(); 70 $c = new $v('0', '0', $params[ $_tmp[1] ]); 71 ob_get_clean(); 72 $params[ 'import-' . $_tmp[1] ] = $c->getImport(); 59 if ( !is_array($params) ) { 60 return $params; 61 } 62 foreach ( $params as $k => $v ) { 63 $value = sanitize_text_field(wp_unslash($v)); 64 $allowed_classes = array( 65 'wpdreamsCategories', 66 'wpdreamsCustomFields', 67 'wpdreamsCustomPostTypes', 68 'wpdreamsCustomPostTypesEditable', 69 ); 70 71 if ( str_starts_with($k, 'classname-') && in_array($value, $allowed_classes, true) ) { 72 $_tmp = explode('classname-', $k); 73 if ( $_tmp !== null && count($_tmp) > 1 && isset($params[ $_tmp[1] ]) ) { 74 ob_start(); 75 $c = new $value('0', '0', Str::anyToString($params[ $_tmp[1] ]) ); 76 ob_get_clean(); 77 $params[ 'selected-' . $_tmp[1] ] = $c->getSelected(); 78 } 73 79 } 74 80 } … … 453 459 454 460 if ( !function_exists('wd_substr_at_word') ) { 455 function wd_substr_at_word( $text, $length ) { 456 if ( strlen($text) <= $length ) { 461 /** 462 * Substring cut off at word endings 463 * 464 * @param $text 465 * @param $length 466 * @param $suffix 467 * @param $tolerance 468 * @return string 469 */ 470 function wd_substr_at_word( $text, $length, $suffix = ' ...', $tolerance = 8 ) { 471 472 if ( function_exists('mb_strlen') && 473 function_exists('mb_strrpos') && 474 function_exists('mb_substr') 475 ) { 476 $fn_strlen = 'mb_strlen'; 477 $fn_strrpos = 'mb_strrpos'; 478 $fn_substr = 'mb_substr'; 479 } else { 480 $fn_strlen = 'strlen'; 481 $fn_strrpos = 'strrpos'; 482 $fn_substr = 'substr'; 483 } 484 485 if ( $fn_strlen($text) <= $length ) { 457 486 return $text; 458 487 } 459 $blog_charset = get_bloginfo('charset'); 460 $charset = $blog_charset !== '' ? $blog_charset : 'UTF-8'; 461 $s = mb_substr($text, 0, $length, $charset); 462 return mb_substr($s, 0, strrpos($s, ' '), $charset); 488 489 $s = $fn_substr($text, 0, $length); 490 $s = $fn_substr($s, 0, $fn_strrpos($s, ' ')); 491 492 // In case of a long mash-up, it will not let overflow the length 493 if ( $fn_strlen($s) > ( $length + $tolerance ) ) { 494 $s = $fn_substr($s, 0, ( $length + $tolerance )); 495 } 496 497 if ( $suffix !== '' && $fn_strlen($s) !== $fn_strlen($text) ) { 498 $s .= $suffix; 499 } 500 501 return $s; 463 502 } 464 503 } -
ajax-search-lite/trunk/includes/views/asl.shortcode.settings.php
r3349879 r3377501 144 144 </div> 145 145 <div class="asl_option_label"> 146 <?php echo esc_ attr(asl_icl_t('Search filter for post type: ' . $v[1], $v[1])); ?>146 <?php echo esc_html(asl_icl_t('Search filter for post type: ' . $v[1], $v[1])); ?> 147 147 </div> 148 148 </div> -
ajax-search-lite/trunk/languages/ajax-search-lite.pot
r3367932 r3377501 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Ajax Search Lite 4.13. 3\n"5 "Project-Id-Version: Ajax Search Lite 4.13.4\n" 6 6 "Report-Msgid-Bugs-To: https://github.com/WPDreams/ajax-search-lite\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025- 09-25T14:47:21+00:00\n"12 "POT-Creation-Date: 2025-10-11T11:40:31+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 1630 1630 1631 1631 #: backend/tabs/instance/layout/results_layout.php:194 1632 msgid "Result title length" 1633 msgstr "" 1634 1635 #: backend/tabs/instance/layout/results_layout.php:199 1632 1636 msgid "Show author in results?" 1633 1637 msgstr "" 1634 1638 1635 #: backend/tabs/instance/layout/results_layout.php: 1991639 #: backend/tabs/instance/layout/results_layout.php:204 1636 1640 msgid "Show date in results?" 1637 1641 msgstr "" 1638 1642 1639 #: backend/tabs/instance/layout/results_layout.php:2 051643 #: backend/tabs/instance/layout/results_layout.php:210 1640 1644 msgid "Use custom date format?" 1641 1645 msgstr "" 1642 1646 1643 #: backend/tabs/instance/layout/results_layout.php:21 41647 #: backend/tabs/instance/layout/results_layout.php:219 1644 1648 msgid " format" 1645 1649 msgstr "" 1646 1650 1647 #: backend/tabs/instance/layout/results_layout.php:22 41651 #: backend/tabs/instance/layout/results_layout.php:229 1648 1652 msgid "If turned OFF, it will use WordPress defaults. Default custom value: Y-m-d H:i:s" 1649 1653 msgstr "" 1650 1654 1651 #: backend/tabs/instance/layout/results_layout.php:2 291655 #: backend/tabs/instance/layout/results_layout.php:234 1652 1656 msgid "Show description in results?" 1653 1657 msgstr "" 1654 1658 1655 #: backend/tabs/instance/layout/results_layout.php:23 41659 #: backend/tabs/instance/layout/results_layout.php:239 1656 1660 msgid "Display the description context?" 1657 1661 msgstr "" 1658 1662 1659 #: backend/tabs/instance/layout/results_layout.php:2 351663 #: backend/tabs/instance/layout/results_layout.php:240 1660 1664 msgid " ..depth" 1661 1665 msgstr "" 1662 1666 1663 #: backend/tabs/instance/layout/results_layout.php:24 31667 #: backend/tabs/instance/layout/results_layout.php:248 1664 1668 msgid "Will display the description from around the search phrase, not from the beginning." 1665 1669 msgstr "" 1666 1670 1667 #: backend/tabs/instance/layout/results_layout.php:2 481671 #: backend/tabs/instance/layout/results_layout.php:253 1668 1672 msgid "Description length" 1669 1673 msgstr ""
Note: See TracChangeset
for help on using the changeset viewer.