LLMS_REST_Courses_Controller::get_taxonomy_rest_base( object $taxonomy )
Maps a taxonomy name to the relative rest base
Parameters Parameters
- $taxonomy
-
(object) (Required) The taxonomy object.
Return Return
(string) The taxonomy rest base.
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-courses-controller.php
protected function get_taxonomy_rest_base( $taxonomy ) {
$base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name;
$taxonomy_base_map = array(
'course_cat' => 'categories',
'course_difficulty' => 'difficulties',
'course_tag' => 'tags',
'course_track' => 'tracks',
);
return isset( $taxonomy_base_map[ $base ] ) ? $taxonomy_base_map[ $base ] : $base;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0-beta.1 | Introduced. |