Skip to content

Rename section (WPML-aware)

PATCH
/wp-json/wp2/course-manager/v1/sections/{id}
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.

id
required
integer

Numeric entity id.

Media typeapplication/json
object
name
required

Human-readable name.

string
Example
{
"name": "example"
}

OK

Media typeapplication/json
object
id

Numeric entity id.

integer
name

Human-readable name.

string
slug

Slug (site, post, or section).

string
count

Count.

integer
order

Sort order.

integer
icon

Section icon.

string
Examplegenerated
{
"id": 1,
"name": "example",
"slug": "example",
"count": 1,
"order": 1,
"icon": "example"
}

Wp2sf_empty_name / wp2sf_bad_taxonomy

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

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.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

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.

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}

Wp2sf_not_found

Media typeapplication/json
object
code

Machine-readable error or event code.

string
message

Message text (log, PIN, or password reset).

string
data

Extra WP_Error or license payload.

object
Examplegenerated
{
"code": "example",
"message": "example",
"data": {}
}