Opened 18 years ago
Closed 18 years ago
#7750 closed defect (bug) (duplicate)
the_content()'s hard coded str_replace() should be (re)moved
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.6.1 |
| Component: | Template | Keywords: | |
| Focuses: | Cc: |
Description
I'm using a the_content to add some Javascript to the end of each post. However I'm having an incredibly difficult time doing it due to how the_content() is hard coded:
`function the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = ) {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
}`
What purpose does it serve? Do we still need it?
If so, it should be moved to a filter so plugins can hook in after it.
Change History (5)
Note: See
TracTickets for help on using
tickets.
Er, whoops.
function the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; }There we go.