add_action( 'rest_api_init', 'myfunction_name' ); function myfunction_name() { register_rest_field( 'endpoint_name', 'field_name', array( 'get_callback' => 'get_data', 'update_callback' => null, 'schema' => null, ) ); } function get_data() { $my_array = get_post_meta( 15, "db_column", false ); return $my_array; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)