-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6aed1c0
commit fea9890
Showing
2 changed files
with
61 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Corrections | ||
|
||
This feature allows authors to add article corrections to the top or bottom of a post. | ||
|
||
## How it works | ||
|
||
When you enable this feature, a new meta box will be added to the post editor screen. You can use this meta box to add a correction to the post. The correction will be displayed at the top or bottom of the post, depending on the settings. | ||
|
||
## Usage | ||
|
||
This feature can be enabled by adding the following constant to your `wp-config.php`: | ||
|
||
```php | ||
define( 'NEWSPACK_CORRECTIONS_ENABLED', true ); | ||
``` | ||
|
||
## Data | ||
|
||
Corrections are stored as `newspack_correction` custom post type. A correction consists of the following fields: | ||
|
||
| Name | Type | Stored As | Description | | ||
| ----------------------------- | -------- | -------------- | --------------------------------------------------------------- | | ||
| `title` | `string` | `post_title` | The correction title. Defaults to 'Correction for [post title]' | | ||
| `content` | `string` | `post_content` | The correction text. | | ||
| `newspack_correction_date` | `string` | `post_meta` | Correction date. Note this is different from the post date. | | ||
| `newspack_correction-post-id` | `int` | `post_meta` | The ID of the post to which the correction is associated. | | ||
|
||
In addition, some correction data is stored in the associated post as post meta: | ||
|
||
| Name | Type | Stored As | Description | | ||
| ------------------------------- | ----------------------- | ----------- | ------------------------------------------------------------- | | ||
| `newspack_corrections_active` | `bool` | `post_meta` | Whether the feature is enabled for the post. | | ||
| `newspack_corrections_location` | `string` | `post_meta` | Where the correction should be displayed. (`top` or `bottom`) | | ||
| `newspack_corrections_ids` | `array` | `post_meta` | An array of IDs of the corrections associated with the post. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters