Opened 10 years ago
Closed 10 years ago
#38919 closed defect (bug) (fixed)
REST API: Can't unset password
| Reported by: | iseulde | Owned by: | joehoyle |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.7 |
| Component: | REST API | Version: | 4.7 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
Once a password is set, it's not possible to unset it. The password is explicitly prevented from being set when it's an empty string:
if ( ! empty( $schema['properties']['password'] ) && isset( $request['password'] ) && '' !== $request['password'] ) {
$prepared_post->post_password = $request['password'];
...
Is there a reason for this? Not sure if I'm missing something.
Attachments (1)
Change History (8)
#3
@
10 years ago
Why are there two separate error messages? 'A post can not be sticky and have a password.' and 'A sticky post can not be password protected.'
This ticket was mentioned in Slack in #core by helen. View the logs.
10 years ago
#5
@
10 years ago
@swissspidy Technically, there are two separate scenarios: Post already has sticky=true, vs. sticky=true is in the request.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Itsabug!