register_api_field

Backwards compat shim.

Description

register_api_field( $object_type, $attributes, (array) $args = array() ); 

Parameters (3)

0. $object_type
The object type.
1. $attributes
The attributes.
2. $args — Optional. (array) => array()
The args.

Usage

  1. if ( !function_exists( 'register_api_field' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/vendor/wp-rest-functions.php'; 
  3.  
  4. // The object type. 
  5. $object_type = null; 
  6.  
  7. // The attributes. 
  8. $attributes = null; 
  9.  
  10. // The args. 
  11. $args = array(); 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = register_api_field($object_type, $attributes, $args); 
  15.  

Defined (1)

The function is defined in the following location(s).

/includes/vendor/wp-rest-functions.php  
  1. function register_api_field( $object_type, $attributes, $args = array() ) { 
  2. wc_deprecated_function( 'register_api_field', 'WPAPI-2.0', 'register_rest_field' ); 
  3. register_rest_field( $object_type, $attributes, $args );