public function getBookTerms( $url ) {
		$terms = [];

		foreach ( [ 'front-matter-type', 'chapter-type', 'back-matter-type', 'glossary-type' ] as $taxonomy ) {
			// Handle request (local or global)
			$response = $this->handleGetRequest(
				$url, 'pressbooks/v2', "$taxonomy", [
					'per_page' => 25,
				]
			);

			if ( is_wp_error( $response ) ) {
				continue;
			}

			// Remove links
			unset( $response['_links'] );

			// Process response
			$terms = array_merge( $terms, $response );
		}

		if ( empty( $terms ) ) {
			$_SESSION['pb_errors'][] = sprintf( '<p>%1$s</p>', __( 'The source book&rsquo;s taxonomies could not be read.', 'pressbooks' ) );
		}

		return $terms;
	}
public function getBookTerms( $url ) {
		$terms = [];

		foreach ( [ 'front-matter-type', 'chapter-type', 'back-matter-type', 'glossary-type' ] as $taxonomy ) {
			// Handle request (local or global)
			$response = $this->handleGetRequest(
				$url, 'pressbooks/v2', "$taxonomy", [
					'per_page' => 25,
				]
			);

			if ( is_wp_error( $response ) ) {
				continue;
			}

			// Remove links
			unset( $response['_links'] );

			// Process response
			$terms = array_merge( $terms, $response );
		}

		if ( empty( $terms ) ) {
			$_SESSION['pb_errors'][] = sprintf( '<p>%1$s</p>', __( 'The source book&rsquo;s taxonomies could not be read.', 'pressbooks' ) );
		}

		return $terms;
	}
public function getBookTerms ( $ url ) { $ terms = [ ] ; foreach ( [ 'front-matter-type' , 'chapter-type' , 'back-matter-type' , 'glossary-type' ] as $ taxonomy ) { // Handle request (local or global) $ response = $ this -> handleGetRequest ( $ url , 'pressbooks/v2' , "$taxonomy" , [ 'per_page' => 25 , ] ) ; if ( is_wp_error ( $ response ) ) { continue ; } // Remove links unset ( $ response [ '_links' ] ) ; // Process response $ terms = array_merge ( $ terms , $ response ) ; } if ( empty ( $ terms ) ) { $ _SESSION [ 'pb_errors' ] [ ] = sprintf ( '<p>%1$s</p>' , __ ( 'The source book&rsquo;s taxonomies could not be read.' , 'pressbooks' ) ) ; } return $ terms ; }
Fetch an array containing the terms of a book.

@since 4.1.0

@param string $url The URL of the book.

@return array
Fetch an array containing the terms of a book .