WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#8156 closed defect (bug) (fixed)

Unable to remove (more...) link from the_content();

Reported by: martinkivi Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.7
Component: Template Keywords:
Focuses: Cc:

Description

Hi

For the Wordpress 2.7 following code was added to lines 182-183 in post-template.php

if ( null == $more_link_text )
$more_link_text = ( '(more...)' );

Unfortunately using this denies the possibility to removed (more...) link from the_content(); completely. Both the_content(); and <?php the_content(,FALSE,); ?> work properly with 2.6.3 codebase, but doesn't work with 2.7.

I assume that this happens because when you have <?php the_content(,FALSE,); ?> it gives it a 0 value, which then gets replaced with (more...) text.

Best regards,
Martin Kivi

Change History (6)

comment:1 @johnconners6 years ago

Note that you can pass a space - ' ' - as the $more_link_text parameter to the_content() and that'll give you the same behaviour passing in did in 2.6.3 (i.e. it won't show the '(more...)' link). Also note that passing ' ' in 2.6.3 gives the same behaviour as passing .

comment:2 @johnconners6 years ago

Oops, let's try that again without the inverted commas being stripped...

Note that you can pass a space - ' ' - as the $more_link_text parameter to the_content() and that'll give you the same behaviour passing in nothing or an empty string did in 2.6.3 (i.e. it won't show the '(more...)' link). Passing in a space to 2.6.3 does the same so is forwards/backwards compatible.

comment:3 @martinkivi6 years ago

Yes, passing the space is one solution, but it's not quite the best one since the <a href="http://hostname/?p=26#more-26" class="more-link"> </a> still remains in there. The goal would be that the link itself could be removed completely in order to create a new read more link somewhere else.

comment:4 @johnconners6 years ago

Yeah, you're right, while not visible to the user the link is still there. Not a perfect workaround but the only one I could find for the time being so thought it was worth a mention.

comment:5 @DD326 years ago

changing it to:

if ( null === $more_link_text )
    $more_link_text = __( '(more...)' );

would restore the previous behaviour wouldnt it? null !== false / null !==

comment:6 @ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [9816]) Use default text only if === null. Props DD32. fixes #8156

Note: See TracTickets for help on using tickets.