| 1 |
<?php |
| 2 |
/** |
| 3 |
* Loop Summary |
| 4 |
* |
| 5 |
* @author PropertyHive |
| 6 |
* @package PropertyHive/Templates |
| 7 |
* @version 1.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 11 |
|
| 12 |
global $property; |
| 13 |
|
| 14 |
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone. |
| 15 |
$summary_length = apply_filters('propertyhive_search_summary_length', 300); |
| 16 |
?> |
| 17 |
<div class="summary"> |
| 18 |
|
| 19 |
<?php |
| 20 |
echo esc_html( substr( wp_strip_all_tags( $property->post_excerpt ), 0, $summary_length ) ); |
| 21 |
if ( strlen(wp_strip_all_tags($property->post_excerpt)) > $summary_length ) { echo '...'; } |
| 22 |
?> |
| 23 |
|
| 24 |
</div> |