Prepares a single term for create or update.
Parameters
$request
WP_REST_Requestrequired- Request object.
Source
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;
}
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.