تابع ووکامرسی register_api_field ثبت فیلد api جدید برای استفاده از REST API

تابع ووکامرسی register_api_field ثبت فیلد api جدید برای استفاده از REST API

تابع ووکامرسی register_api_field – ثبت فیلد api جدید برای استفاده از api های ووکامرس

Syntax – سینتکس

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

Parameters – پارامتر ها (3)

  • 1- $object_type (array)
  • 2- $attributes
  • 3- $args

Usage – نحوه استفاده

if ( !function_exists( 'register_api_field' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/vendor/wp-rest-functions.php'; 
} 
  
// The object type. 
$object_type = null; 
  
// The attributes. 
$attributes = null; 
  
// The args. 
$args = array(); 
  
// NOTICE! Understand what this does before running. 
$result = register_api_field($object_type, $attributes, $args); 
    

Defined – محل تعریف

/includes/vendor/wp-rest-functions.php

function register_api_field( $object_type, $attributes, $args = array() ) { 
    wc_deprecated_function( 'register_api_field', 'WPAPI-2.0', 'register_rest_field' ); 
    register_rest_field( $object_type, $attributes, $args ); 
} 

versions – نسخه ها

از نسخه : 3.0.2

نسخه فعلی : 3.0.6

دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2

ارسال نظر

جهت استفاده از کد حتما از تگ pre استفاده نمایید .

contact us