Opened 13 years ago
Closed 13 years ago
#14323 closed defect (bug) (fixed)
Quick Edit stores filtering of title to database
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Quick/Bulk Edit | Keywords: | has-patch |
Focuses: | Cc: |
Description
line 1188 of /wp-admin/includes/template.php
consists of this line:
$title = esc_attr( get_the_title( $post->ID ) );
$title
is later stored to the title text field in the quick edit form for posts.
The problem with this structure is that any filtering done by plugins on the the_title
hook is saved to the database via the quick edit form – creating destructive change that is not reversed when the plugin is deactivated.
Please consider using the_title_attribute
or a direct db call so that the the_title
hook is not called.
Attachments (1)
Change History (10)
#2
follow-up:
↓ 5
@
13 years ago
The root cause is that 'the_title' filter is applied in get_the_title(), when it should logically be applied in the_title().
#5
in reply to:
↑ 2
;
follow-up:
↓ 6
@
13 years ago
- Keywords has-patch added; destructive filtering removed
- Owner set to filosofo
- Status changed from new to accepted
Replying to scribu:
The root cause is that 'the_title' filter is applied in get_the_title(), when it should logically be applied in the_title().
Could you elaborate on why you think that would be more logical? the_title()
basically just prints get_the_title()
with optional prepended and appended text, so I don't see why it would need its own filter.
I think the issue in this ticket is using filtered content at all for a field that's going to be saved.
#6
in reply to:
↑ 5
;
follow-up:
↓ 7
@
13 years ago
Replying to filosofo:
Replying to scribu:
The root cause is that 'the_title' filter is applied in get_the_title(), when it should logically be applied in the_title().
Could you elaborate on why you think that would be more logical?
the_title()
basically just printsget_the_title()
with optional prepended and appended text, so I don't see why it would need its own filter.
Because it would be consistent with a lot of other template tags like the_content() & get_the_content(), the_excerpt() & get_the_excerpt() etc.
That said, your patch is the best solution in this case.
#7
in reply to:
↑ 6
@
13 years ago
Replying to scribu:
Because it would be consistent with a lot of other template tags like the_content() & get_the_content(), the_excerpt() & get_the_excerpt() etc.
That behavior is maintained for backwards-compatibility reasons; those particular functions are among the most problematic in WP for numerous reasons, so I hope you don't look to them for precedent. :)
The issue can be recreated with the wp-Typography plugin: