Remove old excerpt fix
Seems not to work anymore.
This commit is contained in:
parent
17e086c0f7
commit
e20d508710
@ -57,6 +57,10 @@ if ( get_option( 'fictioneer_enable_sitemap' ) && ! fictioneer_seo_plugin_active
|
||||
|
||||
/**
|
||||
* Change excerpt length
|
||||
*
|
||||
* @since 4.0.0
|
||||
*
|
||||
* @param int $length The current excerpt length in words.
|
||||
*/
|
||||
|
||||
function fictioneer_custom_excerpt_length( $length ) {
|
||||
@ -64,41 +68,6 @@ function fictioneer_custom_excerpt_length( $length ) {
|
||||
}
|
||||
add_filter( 'excerpt_length', 'fictioneer_custom_excerpt_length' );
|
||||
|
||||
// =============================================================================
|
||||
// FIX EXCERPT FORMATTING
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* Fix inconsistent line breaks in excerpts
|
||||
*
|
||||
* @since 4.0
|
||||
* @link https://github.com/WordPress/gutenberg/issues/15117
|
||||
*
|
||||
* @param string $excerpt The post excerpt.
|
||||
*/
|
||||
|
||||
function fictioneer_fix_excerpt( $excerpt ) {
|
||||
add_filter( 'the_content', 'fictioneer_replace_br_with_whitespace', 6 );
|
||||
$excerpt = wp_trim_excerpt( $excerpt );
|
||||
remove_filter( 'the_content', 'fictioneer_replace_br_with_whitespace', 6 );
|
||||
|
||||
return $excerpt;
|
||||
}
|
||||
remove_filter( 'get_the_excerpt', 'wp_trim_excerpt' );
|
||||
add_filter( 'get_the_excerpt', 'fictioneer_fix_excerpt' );
|
||||
|
||||
/**
|
||||
* Replace line breaks with whitespace
|
||||
*
|
||||
* @since 4.0
|
||||
*
|
||||
* @param string $text String to process.
|
||||
*/
|
||||
|
||||
function fictioneer_replace_br_with_whitespace( $text ) {
|
||||
return str_replace( '<br>', ' ', $text );
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// CUSTOMIZE ADMIN BAR
|
||||
// =============================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user