| @@ -62,8 +62,11 @@ | ||
| 62 | 62 | ], |
| 63 | 63 | $settings |
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | + // Fill display flags the request may have omitted (see trait) before the render loop reads them. | |
| 67 | + $settings = array_merge( $this->loadmore_display_defaults(), $settings ); | |
| 68 | + | |
| 66 | 69 | $ajaxposts = $this->query_args( $settings ); |
| 67 | 70 | |
| 68 | 71 | ob_start(); |
| 69 | 72 | $found_posts = false; |
| @@ -198,11 +201,11 @@ | ||
| 198 | 201 | if ( has_excerpt() ) { |
| 199 | 202 | the_excerpt(); |
| 200 | 203 | } else { |
| 201 | 204 | if ( function_exists( 'ultimate_post_kit_custom_excerpt' ) ) { |
| 202 | - echo wp_kses_post( ultimate_post_kit_custom_excerpt( intval( $settings['excerpt_length'] ?? 20 ), false, '' ) ); | |
| 205 | + echo wp_kses_post( ultimate_post_kit_custom_excerpt( ultimate_post_kit_clamp_excerpt_length( $settings['excerpt_length'] ?? 20, 20 ), false, '' ) ); | |
| 203 | 206 | } else { |
| 204 | - echo esc_html( wp_trim_words( wp_strip_all_tags( get_the_content() ), intval( $settings['excerpt_length'] ?? 20 ) ) ); | |
| 207 | + echo esc_html( wp_trim_words( wp_strip_all_tags( get_the_content() ), ultimate_post_kit_clamp_excerpt_length( $settings['excerpt_length'] ?? 20, 20 ) ) ); | |
| 205 | 208 | } |
| 206 | 209 | } |
| 207 | 210 | ?> |
| 208 | 211 | </div> |