diff --git a/includes/functions/_caching_and_transients.php b/includes/functions/_caching_and_transients.php index c27bcebf..de8bbdd1 100644 --- a/includes/functions/_caching_and_transients.php +++ b/includes/functions/_caching_and_transients.php @@ -382,7 +382,7 @@ if ( ! function_exists( 'fictioneer_refresh_post_caches' ) ) { $story_id = get_post_meta( $post_id, 'fictioneer_chapter_story', true ); if ( ! empty( $story_id ) ) { - $chapters = fictioneer_get_story_chapters( $story_id ); + $chapters = fictioneer_get_story_chapter_ids( $story_id ); delete_post_meta( $story_id, 'fictioneer_story_data_collection' ); fictioneer_purge_post_cache( $story_id ); @@ -398,7 +398,7 @@ if ( ! function_exists( 'fictioneer_refresh_post_caches' ) ) { // Purge associated chapters if ( $post_type == 'fcn_story' ) { - $chapters = fictioneer_get_story_chapters( $post_id ); + $chapters = fictioneer_get_story_chapter_ids( $post_id ); if ( ! empty( $chapters ) ) { foreach ( $chapters as $chapter_id ) { diff --git a/includes/functions/_epub.php b/includes/functions/_epub.php index 3c40a593..74ede130 100644 --- a/includes/functions/_epub.php +++ b/includes/functions/_epub.php @@ -1048,7 +1048,7 @@ function fictioneer_generate_epub() { $story = get_post( $story_id ); $dir = get_template_directory() . '/epubs/'; $folder = "{$story_id}"; - $chapters = fictioneer_get_story_chapters( $story_id ); + $chapters = fictioneer_get_story_chapter_ids( $story_id ); $author = get_the_author_meta( 'display_name', $story->post_author ); $co_authors = get_post_meta( $story_id, 'fictioneer_story_co_authors', true ) ?: []; $all_authors = []; diff --git a/includes/functions/_meta_fields.php b/includes/functions/_meta_fields.php index d2882abb..ffed6b80 100644 --- a/includes/functions/_meta_fields.php +++ b/includes/functions/_meta_fields.php @@ -1898,7 +1898,7 @@ function fictioneer_render_story_data_metabox( $post ) { ); // Chapters - $chapter_ids = fictioneer_get_story_chapters( $post->ID ); + $chapter_ids = fictioneer_get_story_chapter_ids( $post->ID ); $chapters = empty( $chapter_ids ) ? [] : get_posts( array( @@ -2213,7 +2213,7 @@ function fictioneer_save_story_metaboxes( $post_id ) { // Chapters if ( isset( $_POST['fictioneer_story_chapters'] ) && current_user_can( 'edit_fcn_stories', $post_id ) ) { - $previous_chapter_ids = fictioneer_get_story_chapters( $post_id ); + $previous_chapter_ids = fictioneer_get_story_chapter_ids( $post_id ); $chapter_ids = $_POST['fictioneer_story_chapters']; $chapter_ids = is_array( $chapter_ids ) ? $chapter_ids : [ $chapter_ids ]; diff --git a/includes/functions/_post_updates.php b/includes/functions/_post_updates.php index f9ea84e1..2f997e4f 100644 --- a/includes/functions/_post_updates.php +++ b/includes/functions/_post_updates.php @@ -295,7 +295,7 @@ function fictioneer_remove_chapter_from_story( $chapter_id ) { } // Check chapter list - $chapters = fictioneer_get_story_chapters( $story_id ); + $chapters = fictioneer_get_story_chapter_ids( $story_id ); $previous = $chapters; if ( empty( $chapters ) || ! in_array( $chapter_id, $chapters ) ) { diff --git a/includes/functions/_utility.php b/includes/functions/_utility.php index 8097f679..7065dd00 100644 --- a/includes/functions/_utility.php +++ b/includes/functions/_utility.php @@ -270,7 +270,7 @@ if ( ! function_exists( 'fictioneer_get_story_data' ) ) { } // Setup - $chapters = fictioneer_get_story_chapters( $story_id ); + $chapters = fictioneer_get_story_chapter_ids( $story_id ); $tags = get_the_tags( $story_id ); $fandoms = get_the_terms( $story_id, 'fcn_fandom' ); $characters = get_the_terms( $story_id, 'fcn_character' ); @@ -791,19 +791,19 @@ if ( ! function_exists( 'fictioneer_is_editor' ) ) { // GET META FIELDS // ============================================================================= -if ( ! function_exists( 'fictioneer_get_story_chapters' ) ) { +if ( ! function_exists( 'fictioneer_get_story_chapter_ids' ) ) { /** - * Wrapper for get_post_meta() to get story chapters + * Wrapper for get_post_meta() to get story chapter IDs * * @since Fictioneer 5.8.2 * * @param int $post_id Optional. The ID of the post the field belongs to. * Defaults to current post ID. * - * @return array Array of post IDs or an empty array. + * @return array Array of chapter post IDs or an empty array. */ - function fictioneer_get_story_chapters( $post_id = null ) { + function fictioneer_get_story_chapter_ids( $post_id = null ) { // Setup $chapter_ids = get_post_meta( $post_id ?? get_the_ID(), 'fictioneer_story_chapters', true ); @@ -1049,7 +1049,7 @@ function fictioneer_append_chapter_to_story( $post_id, $story_id, $force = false } // Get current story chapters - $story_chapters = fictioneer_get_story_chapters( $story_id ); + $story_chapters = fictioneer_get_story_chapter_ids( $story_id ); // Append chapter (if not already included) and save to database if ( ! in_array( $post_id, $story_chapters ) ) { diff --git a/includes/functions/hooks/_story_hooks.php b/includes/functions/hooks/_story_hooks.php index 78c31cc7..e9a75b25 100644 --- a/includes/functions/hooks/_story_hooks.php +++ b/includes/functions/hooks/_story_hooks.php @@ -505,7 +505,7 @@ function fictioneer_story_chapters( $args ) { // Start HTML ---> ?>
true ) ); $default_description = fictioneer_first_paragraph_as_excerpt( fictioneer_get_content_field( 'fictioneer_story_short_description', $post_id ) ); $chapter_count = 0; diff --git a/includes/functions/settings/_settings_actions.php b/includes/functions/settings/_settings_actions.php index de9f51ef..3e247535 100644 --- a/includes/functions/settings/_settings_actions.php +++ b/includes/functions/settings/_settings_actions.php @@ -1327,7 +1327,7 @@ function fictioneer_tools_append_chapters() { if ( ! empty( $chapter_ids_to_append ) ) { // Prepare - $story_chapters = fictioneer_get_story_chapters( $story_id ); + $story_chapters = fictioneer_get_story_chapter_ids( $story_id ); $count = 0; // Append missing chapters diff --git a/partials/_card-collection.php b/partials/_card-collection.php index ae462746..26c87520 100644 --- a/partials/_card-collection.php +++ b/partials/_card-collection.php @@ -84,7 +84,7 @@ if ( ! empty( $items ) ) { } break; case 'fcn_story': - $chapter_ids = fictioneer_get_story_chapters( $item->ID ); + $chapter_ids = fictioneer_get_story_chapter_ids( $item->ID ); $word_count += fictioneer_get_word_count( $item->ID ); $story_count += 1; diff --git a/rss-rss-story.php b/rss-rss-story.php index 435ccac8..c2700526 100644 --- a/rss-rss-story.php +++ b/rss-rss-story.php @@ -25,7 +25,7 @@ if ( ! $story_id || $is_hidden || post_password_required( $story_id ) ) { // Get story data $story = fictioneer_get_story_data( $story_id, false ); // Does not refresh comment count! -$chapters = fictioneer_get_story_chapters( $story_id ); +$chapters = fictioneer_get_story_chapter_ids( $story_id ); // Feed title $title = sprintf(