WordPress.org

WordPRess GSoC

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#284 closed task (fixed)

file <-> post connection

Reported by: a.hoereth Owned by: a.hoereth
Milestone: 2013 Midterm (Beta) Priority: normal
Component: Code Revisions Keywords:
Cc:

Description

How to connect an edited code file to an specific post of a custom post type (atm called 'code') in the database?

a) Unique title-slug in the following style "author: package: filename"
b) Serialized array containing file, package & author saved in a post meta field.

I am preferring b atm. Implementation coming up shortly.

Change History (6)

#1 @a.hoereth
4 years ago

  • Keywords has-patch 2nd-opinion added
  • Milestone 2013 Midterm (Beta) deleted
  • Resolution set to worksforme
  • Status changed from new to closed

[1995] implements option b.
The corresponding post for a file is retrieved using a custom wpdb query: retrieve() - "get post id by meta key value pair"

This ensures that we later can smoothly use this data to redirect to the editors etc. Furthermore we can use clean and nice post titles which will be displayed on wp-admin/revisions.php

#2 @a.hoereth
4 years ago

See Unique Theme/Plugin identifier on wp-hackers for reference. Nacin recommended to use slug + filename. My current implementation uses author + slug + filename. I included the author for more uniqueness, which could lead to errors when the author changes.

#3 @a.hoereth
4 years ago

  • Milestone set to 2013 Midterm (Beta)

#4 @a.hoereth
4 years ago

In 2000:

Refreshed handling of file information. Use get_posts instead of custom wpdb query for retrieving the associated post. See #284

#5 @a.hoereth
4 years ago

  • Owner set to a.hoereth
  • Resolution changed from worksforme to fixed

In 2002:

No longer referencing theme and plugin author's for code revision posts. It is unlikely for one to have two identically named plugins with different authors installed. Furthermore it is not unlikely for a plugin to change maintaining author, which, if author names are used for reference, would break revisions. Fixes #284

#6 @a.hoereth
4 years ago

  • Keywords has-patch 2nd-opinion removed
Note: See TracTickets for help on using tickets.