WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#3188 closed defect (bug) (fixed)

Shouldn't use deprecated functions start_wp

Reported by: foolswisdom Owned by: westi
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.1
Component: General Keywords: has-patch
Focuses: Cc:

Description

Continuing ticket:3186 by Nazgul for remaining deprecated function start_wp

Here's a list of the functions (and between brackets the files that use them):

start_wp (wp-atom.php, wp-rss.php, wp-rss2.php, wp-admin/edit.php, wp-admin/export.php, wp-content/themes/clasdic/comment-popup.php and wp-content/themes/default/comment-popup.php)

Attachments (2)

3188.diff (6.6 KB) - added by westi 8 years ago.
Deprecate start_wp
end_to_start_wp.diff (1.9 KB) - added by westi 8 years ago.
Kill off the final start_wp call

Download all attachments as: .zip

Change History (15)

comment:1 @westi8 years ago

  • Owner changed from anonymous to westi
  • Status changed from new to assigned

I'm working on this.

@westi8 years ago

Deprecate start_wp

comment:2 @westi8 years ago

  • Keywords has-patch added

Attached patch deprecates start_wp in all the listed places.

Also extends WP_Query to support post_type = all so as to enable using it for the exporter query.

Please test and feedback

comment:3 @ryan8 years ago

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

(In [4465]) Don't use deprecated start_wp(). Props westi. fixes #3188

comment:4 follow-up: @ryan8 years ago

Didn't include the export changes since the exporter needs to export posts of any status and not just publish.

comment:5 in reply to: ↑ 4 @westi8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to ryan:

Didn't include the export changes since the exporter needs to export posts of any status and not just publish.

I tried to fix this with the new query var for post_type=all I guess i missed the post_status check as well.

I'll try and put up a patch to fix that one last occurrence by extending wp query to give us a way of getting every post/page back whatever the type /status

comment:6 @westi8 years ago

  • Keywords has-patch removed

@westi8 years ago

Kill off the final start_wp call

comment:7 @westi8 years ago

  • Keywords has-patch added

Attached patch fixes the exporter to use the API and kills off start_wp for good

comment:8 follow-up: @matt8 years ago

Wouldn't this allow someone to put export in the query string on someone's blog or RSS feed and grab the whole thing?

comment:9 in reply to: ↑ 8 @westi8 years ago

Replying to matt:

Wouldn't this allow someone to put export in the query string on someone's blog or RSS feed and grab the whole thing?

Well post_type is a private query var (http://trac.wordpress.org/browser/trunk/wp-includes/classes.php#L6).

I'm not entirely sure how that affects where or not it is allowed in the url without spending more time reading the code.

However it probably should.

comment:10 @matt8 years ago

  • Milestone changed from 2.1 to 2.2

comment:11 @foolswisdom8 years ago

  • Milestone changed from 2.2 to 2.3

comment:12 @ryan8 years ago

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

(In [6077]) Use setup_postdata instead of deprecated start_wp. fixes #3188

comment:13 @ryan8 years ago

I simply changed it to use setup_postdata() instead of start_wp(). All we needed from start_wp was the postdata setup.

Note: See TracTickets for help on using tickets.