Rename section (WPML-aware)
const url = 'https://example.com/wp-json/wp2/course-manager/v1/sections/1';const options = { method: 'PATCH', headers: {'X-WP-Nonce': '<X-WP-Nonce>', 'Content-Type': 'application/json'}, body: '{"name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/wp-json/wp2/course-manager/v1/sections/1 \ --header 'Content-Type: application/json' \ --header 'X-WP-Nonce: <X-WP-Nonce>' \ --data '{ "name": "example" }'Renames a section (name field). On a multilingual site this follows the current WPML lang. WP EDITABLE also accepts PUT/POST.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Numeric entity id.
Request Body
Section titled “Request Body”object
Human-readable name.
Example
{ "name": "example"}Responses
Section titled “Responses”OK
object
Numeric entity id.
Human-readable name.
Slug (site, post, or section).
Count.
Sort order.
Section icon.
Examplegenerated
{ "id": 1, "name": "example", "slug": "example", "count": 1, "order": 1, "icon": "example"}Wp2sf_empty_name / wp2sf_bad_taxonomy
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Not authenticated. WordPress REST: rest_not_logged_in / rest_forbidden. Use cookie + X-WP-Nonce or Application Password.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Insufficient capability or invalid REST nonce. WordPress REST: rest_forbidden / rest_cookie_invalid_nonce.
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Wp2sf_not_found
object
Machine-readable error or event code.
Message text (log, PIN, or password reset).
Extra WP_Error or license payload.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}