/**
* Prepares a single term for create or update.
*
* @since 5.9.0
*
* @param WP_REST_Request $request Request object.
* @return object Prepared term data.
*/
public function prepare_item_for_database( $request ) { $prepared_term = parent::
prepare_item_for_database( $request );
$schema =
$this->
get_item_schema();
if ( isset( $request['name'
] ) && !
empty( $schema['properties'
]['name'
] ) ) { $prepared_term->
{'menu-name'
} =
$request['name'
];
} return $prepared_term;
} /**
* Creates a single term in a taxonomy.
*
* @since 5.9.0
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/