Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#31510 closed defect (bug) (invalid)

the_title() is working wrong when a post title have space character like "old education"

Reported by: ali1to's profile ali1to Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.1
Component: General Keywords:
Focuses: Cc:

Description

this is my code in below line
<a href=<?php the_permalink();?> title=<?php the_title()?>>222</a>
my current post title is "old education" but printed html markup is
<a href="http://localhost/wordpress/?p=56" title="Old" education="">222</a>

Change History (1)

#1 @SergeyBiryukov
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

There are missing quotes and escaping in your code. This would be correct:

<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">222</a>

Please try the support forums if you have further questions.

Note: See TracTickets for help on using tickets.