From da38d9cdabe7f1e83af575d4618364fe00af2f12 Mon Sep 17 00:00:00 2001 From: Ned Zimmerman Date: Mon, 30 Jul 2018 12:20:42 -0300 Subject: [PATCH] Fix catalog subjects issue --- inc/helpers/namespace.php | 3 ++- partials/book.php | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/inc/helpers/namespace.php b/inc/helpers/namespace.php index 040cf2f..8f521ba 100644 --- a/inc/helpers/namespace.php +++ b/inc/helpers/namespace.php @@ -8,6 +8,7 @@ namespace Aldine\Helpers; use function \Pressbooks\Metadata\book_information_to_schema; +use function \Pressbooks\Metadata\is_bisac; use Pressbooks\Book; /** @@ -148,7 +149,7 @@ function get_available_licenses( $catalog_data ) { function get_available_subjects( $catalog_data ) { $subjects = []; foreach ( $catalog_data['books'] as $book ) { - if ( ! empty( $book['subject'] ) ) { + if ( ! empty( $book['subject'] ) && ! is_bisac( $book['subject'] ) ) { $subjects[ substr( $book['subject'], 0, 1 ) ][] = substr( $book['subject'], 0, 2 ); } } diff --git a/partials/book.php b/partials/book.php index 4445ace..6e37702 100644 --- a/partials/book.php +++ b/partials/book.php @@ -1,7 +1,10 @@ - +