Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#10487 closed feature request (wontfix)

Improved meta API

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

Description

Yes, discussions on the topic can be seen here:

#5183 #2659

But they focus on table structure, not on the api. Hence, the new ticket.

Discussions on the api (as well as the table structure) can be found on wp-hackers: and also on wp-hackers: 1 2

Attachments (4)

meta-testing.php (591 bytes) - added by scribu 14 years ago.
plugin for basic testing
meta_api.diff (14.0 KB) - added by scribu 14 years ago.
first draft
meta-testing.2.php (744 bytes) - added by scribu 14 years ago.
plugin for basic testing
meta_upgrade.diff (1.3 KB) - added by scribu 14 years ago.
code to migrate data to new table

Download all attachments as: .zip

Change History (11)

#1 @scribu
14 years ago

This patch:

  • replaces postmeta with a generic meta table
  • the meta table has enum as meta_type for better performance
  • implements these functions:
register_meta_type($meta_type);

add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = false);

update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '');

delete_metadata($meta_type, $object_id, $meta_key = '', $meta_value = '');

get_metadata($meta_type, $object_id, $key = '', $single = false);

Notice that $meta_key is optional for delete_metadata() and get_metadata().

  • maps these functions:
add_post_meta();

update_post_meta();

delete_post_meta();

get_post_meta();

get_post_custom();

@scribu
14 years ago

plugin for basic testing

@scribu
14 years ago

first draft

#2 @scribu
14 years ago

What's still needed is code to migrate data from postmeta to meta.

@scribu
14 years ago

plugin for basic testing

@scribu
14 years ago

code to migrate data to new table

#3 @aaroncampbell
14 years ago

  • Cc aaroncampbell added

#4 @scribu
14 years ago

  • Keywords early added; dev-feedback removed

#6 @scribu
14 years ago

  • Keywords has-patch needs-testing early removed
  • Version set to 2.9

We now have a generic meta API. How do we make it more flexible?

#7 @ryan
14 years ago

  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Closing since we're not doing generic meta.

Note: See TracTickets for help on using tickets.