[wp-trac] [WordPress Trac] #57909: It's not logical that the "Read more"-button disappears when you create a manual excerpt

WordPress Trac noreply at wordpress.org
Sun Mar 12 16:09:52 UTC 2023


#57909: It's not logical that the "Read more"-button disappears when you create a
manual excerpt
-------------------------------+------------------------------
 Reporter:  hero2              |       Owner:  (none)
     Type:  feature request    |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Formatting         |     Version:  1.5
 Severity:  normal             |  Resolution:
 Keywords:  close 2nd-opinion  |     Focuses:
-------------------------------+------------------------------
Changes (by costdev):

 * keywords:  changes-requested => close 2nd-opinion
 * focuses:  ui =>
 * component:  Post Thumbnails => Formatting
 * version:  6.1.1 => 1.5


Comment:

 Hi @hero2, welcome to Trac and thanks for opening this ticket.

 The "More" text/link has only been added for automatically generated
 excerpts since WordPress 1.5.0 (circa 2005).

 To add this as the default now should be considered very carefully with
 respect to backward compatibility, expectations, and theme-specific needs.

 Alternatively, you can add the "More" text/link to all excerpts with
 something like this:

 {{{#!php
 <?php

 add_filter( 'wp_trim_excerpt', 'myprefix_add_read_more', 999 );
 function myprefix_add_read_more( $text ) {
         $read_more = apply_filters( 'excerpt_more', ' […]' );

         if ( ! str_ends_with( $text, $read_more ) ) {
                 $text = rtrim( $text ) . $read_more;
         }

         return $text;
 }
 }}}

 -----

 - Changing the `Version` property to `1.5` when this was introduced with
 `wp_trim_excerpt()`.
 - As this can be achieved using a filter without changing this behaviour
 on all sites, I'm tentatively adding `close` for this to be closed as
 `wontfix`.
 - However, I'm also adding `2nd-opinion` to gather thoughts from others on
 this.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57909#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list