| @@ -286,13 +286,17 @@ | ||
| 286 | 286 | $metadata, |
| 287 | 287 | $score_options |
| 288 | 288 | ); |
| 289 | 289 | |
| 290 | - // Add readability_score and content_quality from frontend if provided | |
| 291 | - if (!empty($readability_score)) { | |
| 290 | + // Add readability_score and content_quality from frontend if | |
| 291 | + // provided. `!== null`, not `!empty()`: 0 is a legitimate score and | |
| 292 | + // empty() discarded it, so a post the editor scored as 0 kept | |
| 293 | + // whatever the calculator had produced instead (#394). Both params | |
| 294 | + // already default to null above, so null means "not sent". | |
| 295 | + if (null !== $readability_score) { | |
| 292 | 296 | $score_data['readability_score'] = $readability_score; |
| 293 | 297 | } |
| 294 | - if (!empty($content_quality)) { | |
| 298 | + if (null !== $content_quality) { | |
| 295 | 299 | $score_data['content_quality'] = $content_quality; |
| 296 | 300 | } |
| 297 | 301 | |
| 298 | 302 | // Save score if requested |