context['dynamirss/article'] ?? null; $field = ( $attributes['source'] ?? 'summary' ) === 'content' ? 'content' : 'summary'; $max = max( 0, (int) ( $attributes['maxLength'] ?? 160 ) ); $wrapper = get_block_wrapper_attributes(); $text = $article ? (string) ( $article[ $field ] ?? $article['summary'] ?? '' ) : __( 'A brief description of the article…', 'dynamirss' ); if ( $max > 0 ) { $has_mb = function_exists( 'mb_strlen' ) && function_exists( 'mb_substr' ); $length = $has_mb ? mb_strlen( $text ) : strlen( $text ); if ( $length > $max ) { $text = rtrim( $has_mb ? mb_substr( $text, 0, $max ) : substr( $text, 0, $max ) ) . '…'; } } printf( '
%s
', wp_kses_post( $wrapper ), esc_html( $text ) );