Metadata


目录

Overview

The Metadata API is a simple and standarized way for retrieving and manipulating metadata of various WordPress object types.

Metadata for an object is a represented by a simple key-value pair.

Objects may contain multiple metadata entries that share the same key and differ only in their value.

Function Reference

Add/Delete Metadata:

Get/Update Metadata:

Database Requirements

This function assumes that a dedicated MySQL table exists for the $meta_type you specify. Some desired $meta_types do not come with pre-installed WordPress tables, and so they must be created manually.

Default Meta Tables

Assuming a prefix of wp_, WordPress’s included meta tables are:

Meta Table Structure

To store data for meta types not included in the above table list, a new table needs to be created. All meta tables require four columns.

Source File

Metadata API is located in wp-includes/meta.php.

Metadata API: add_metadata(), get_metadata(), update_metadata(), delete_metadata().


版本号 #1
由 壳壳虫 创建于 2026-08-29 23:36:33 UTC
由 壳壳虫 更新于 2026-08-29 23:36:33 UTC