WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/30/2016 01:01:35 AM (5 years ago)
Author:
helen
Message:

Introduce an expanded meta registration API.

register_meta() has been altered to accept an array of arguments as the third parameter in order to support its usage beyond XML-RPC, notably in the REST API and other projects that may build on top of meta, such as a potential Fields API. Arguments are whitelisted to reserve the right for core to add more later.

New functions added to complement this expansion are:

  • registered_meta_key_exists()
  • unregister_meta_key()
  • get_registered_meta_keys()
  • get_registered_metadata()
  • A "private" function for the aforementioned whitelisting.

There still need to be lots of tests written for previous and new behaviors, and many things are subject to change. Maybe things will explode. #yolo

props jeremyfelt, ericlewis, sc0ttkclark, helen, rmccue, ocean90, voldemortensen.
see #35658.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-filters.php

    r37920 r37924  
    8585add_filter( 'pre_post_mime_type', 'sanitize_mime_type' );
    8686add_filter( 'post_mime_type', 'sanitize_mime_type' );
     87
     88// Meta
     89add_filter( 'register_meta_args', '_wp_register_meta_args_whitelist', 10, 2 );
    8790
    8891// Places to balance tags on input
Note: See TracChangeset for help on using the changeset viewer.