static function getAllSubsections( $book_structure ) {
		if ( Export::shouldParseSubsections() ) {
			$book_subsections_transient = \Pressbooks\Book::SUBSECTIONS_TRANSIENT;
			$subsection_processing_transient = \Pressbooks\Book::SUBSECTION_PROCESSING_TRANSIENT;
			$book_subsections = get_transient( $book_subsections_transient );
			if ( ! $book_subsections ) {
				$book_subsections = [];
				if ( ! get_transient( $subsection_processing_transient ) ) {
					set_transient( $subsection_processing_transient, 1, 5 * MINUTE_IN_SECONDS );
					foreach ( $book_structure['front-matter'] as $section ) {
						$subsections = \Pressbooks\Book::getSubsections( $section['ID'] );
						if ( $subsections ) {
							$book_subsections['front-matter'][ $section['ID'] ] = $subsections;
						}
					}
					foreach ( $book_structure['part'] as $key => $part ) {
						if ( ! empty( $part['chapters'] ) ) {
							foreach ( $part['chapters'] as $section ) {
								$subsections = \Pressbooks\Book::getSubsections( $section['ID'] );
								if ( $subsections ) {
									$book_subsections['chapters'][ $section['ID'] ] = $subsections;
								}
							}
						}
					}
					foreach ( $book_structure['back-matter'] as $section ) {
						$subsections = \Pressbooks\Book::getSubsections( $section['ID'] );
						if ( $subsections ) {
							$book_subsections['back-matter'][ $section['ID'] ] = $subsections;
						}
					}
					delete_transient( $subsection_processing_transient );
				}
			}
			set_transient( $book_subsections_transient, $book_subsections );
			return $book_subsections;
		}
		return [];
	}
static function getAllSubsections( $book_structure ) {
		if ( Export::shouldParseSubsections() ) {
			$book_subsections_transient = \Pressbooks\Book::SUBSECTIONS_TRANSIENT;
			$subsection_processing_transient = \Pressbooks\Book::SUBSECTION_PROCESSING_TRANSIENT;
			$book_subsections = get_transient( $book_subsections_transient );
			if ( ! $book_subsections ) {
				$book_subsections = [];
				if ( ! get_transient( $subsection_processing_transient ) ) {
					set_transient( $subsection_processing_transient, 1, 5 * MINUTE_IN_SECONDS );
					foreach ( $book_structure['front-matter'] as $section ) {
						$subsections = \Pressbooks\Book::getSubsections( $section['ID'] );
						if ( $subsections ) {
							$book_subsections['front-matter'][ $section['ID'] ] = $subsections;
						}
					}
					foreach ( $book_structure['part'] as $key => $part ) {
						if ( ! empty( $part['chapters'] ) ) {
							foreach ( $part['chapters'] as $section ) {
								$subsections = \Pressbooks\Book::getSubsections( $section['ID'] );
								if ( $subsections ) {
									$book_subsections['chapters'][ $section['ID'] ] = $subsections;
								}
							}
						}
					}
					foreach ( $book_structure['back-matter'] as $section ) {
						$subsections = \Pressbooks\Book::getSubsections( $section['ID'] );
						if ( $subsections ) {
							$book_subsections['back-matter'][ $section['ID'] ] = $subsections;
						}
					}
					delete_transient( $subsection_processing_transient );
				}
			}
			set_transient( $book_subsections_transient, $book_subsections );
			return $book_subsections;
		}
		return [];
	}
static function getAllSubsections ( $ book_structure ) { if ( Export :: shouldParseSubsections ( ) ) { $ book_subsections_transient = \ Pressbooks \ Book :: SUBSECTIONS_TRANSIENT ; $ subsection_processing_transient = \ Pressbooks \ Book :: SUBSECTION_PROCESSING_TRANSIENT ; $ book_subsections = get_transient ( $ book_subsections_transient ) ; if ( ! $ book_subsections ) { $ book_subsections = [ ] ; if ( ! get_transient ( $ subsection_processing_transient ) ) { set_transient ( $ subsection_processing_transient , 1 , 5 * MINUTE_IN_SECONDS ) ; foreach ( $ book_structure [ 'front-matter' ] as $ section ) { $ subsections = \ Pressbooks \ Book :: getSubsections ( $ section [ 'ID' ] ) ; if ( $ subsections ) { $ book_subsections [ 'front-matter' ] [ $ section [ 'ID' ] ] = $ subsections ; } } foreach ( $ book_structure [ 'part' ] as $ key => $ part ) { if ( ! empty ( $ part [ 'chapters' ] ) ) { foreach ( $ part [ 'chapters' ] as $ section ) { $ subsections = \ Pressbooks \ Book :: getSubsections ( $ section [ 'ID' ] ) ; if ( $ subsections ) { $ book_subsections [ 'chapters' ] [ $ section [ 'ID' ] ] = $ subsections ; } } } } foreach ( $ book_structure [ 'back-matter' ] as $ section ) { $ subsections = \ Pressbooks \ Book :: getSubsections ( $ section [ 'ID' ] ) ; if ( $ subsections ) { $ book_subsections [ 'back-matter' ] [ $ section [ 'ID' ] ] = $ subsections ; } } delete_transient ( $ subsection_processing_transient ) ; } } set_transient ( $ book_subsections_transient , $ book_subsections ) ; return $ book_subsections ; } return [ ] ; }
Returns an array of front matter, chapters, and back matter which contain subsections.

@param array $book_structure The book structure from getBookStructure()
@return array The subsections, grouped by parent post type
Returns an array of front matter chapters and back matter which contain subsections .