Apply content filters to Storypath API content node

This commit is contained in:
Tetrakern 2024-08-30 16:44:59 +02:00
parent a7fc7a1ae0
commit 8bec510209
2 changed files with 2 additions and 1 deletions

2
API.md
View File

@ -654,7 +654,7 @@ The following schema defines all fields that can exist within the response, excl
|  ➞ name `string` | Author name.
|  ➞ url `string\|null` | Author website.
| coAuthors `[object]\|null` | Array of co-author nodes. Same as the author node.
| content `string` | Return value of `get_the_content()` without filters applied. Needs processing.
| content `string` | Return value of `get_the_content()` with filters applied. May need further processing.
| description `string` | HTML string from TinyMCE. Needs processing.
| words `integer` | Total number of words of all chapters.
| ageRating `string` | Either Everyone, Teen, Mature, or Adult.

View File

@ -83,6 +83,7 @@ if ( ! function_exists( 'fictioneer_api_get_story_node' ) ) {
$content = get_the_excerpt( $story_id ); // Story likely misused as chapter
} else {
$content = get_the_content( null, false, $story_id );
$content = apply_filters( 'the_content', $content );
}
$description = get_post_meta( $story_id, 'fictioneer_story_short_description', true );