Add lastModifiedStory node to storygraph
Makes it easier to find the last modified story in the collection.
This commit is contained in:
parent
268edbdd1a
commit
442434cd5f
@ -166,7 +166,7 @@ if ( ! defined( 'FICTIONEER_API_STORYGRAPH_CHAPTERS' ) ) {
|
||||
|
||||
// Boolean: Storygraph API Transients caching
|
||||
if ( ! defined( 'FICTIONEER_API_STORYGRAPH_TRANSIENTS' ) ) {
|
||||
define( 'FICTIONEER_API_STORYGRAPH_TRANSIENTS', true );
|
||||
define( 'FICTIONEER_API_STORYGRAPH_TRANSIENTS', false );
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
@ -382,6 +382,11 @@ if ( ! function_exists( 'fictioneer_api_request_stories' ) ) {
|
||||
|
||||
// Add to graph
|
||||
$graph['stories'][ $story->ID ] = $node;
|
||||
|
||||
// Last modified story?
|
||||
if ( $node['modified'] == $graph['lastModified'] ) {
|
||||
$graph['lastModifiedStory'] = $story->ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user