public function isSourceCloneable( $metadata_license ) {
		$restrictive_licenses = [
			'https://creativecommons.org/licenses/by-nd/4.0/',
			'https://creativecommons.org/licenses/by-nc-nd/4.0/',
			'https://choosealicense.com/no-license/',
		];

		if ( is_array( $metadata_license ) ) {
			$license_url = $metadata_license['url'];
		} else { // Backwards compatibility.
			$license_url = $metadata_license;
		}

		$license_url = trailingslashit( trim( $license_url ) );
		if ( ! empty( $this->sourceBookId ) ) {
			if ( $this->isSuperAdmin ) {
				return true; // Network administrators can clone local books no matter how they're licensed
			} elseif ( ! in_array( $license_url, $restrictive_licenses, true ) ) {
				return true; // Anyone can clone local books that aren't restrictively licensed
			} else {
				return false;
			}
		} elseif ( in_array( $license_url, $restrictive_licenses, true ) ) {
			return false; // No one can clone global books that are restrictively licensed
		}
		return true;
	}
public function isSourceCloneable( $metadata_license ) {
		$restrictive_licenses = [
			'https://creativecommons.org/licenses/by-nd/4.0/',
			'https://creativecommons.org/licenses/by-nc-nd/4.0/',
			'https://choosealicense.com/no-license/',
		];

		if ( is_array( $metadata_license ) ) {
			$license_url = $metadata_license['url'];
		} else { // Backwards compatibility.
			$license_url = $metadata_license;
		}

		$license_url = trailingslashit( trim( $license_url ) );
		if ( ! empty( $this->sourceBookId ) ) {
			if ( $this->isSuperAdmin ) {
				return true; // Network administrators can clone local books no matter how they're licensed
			} elseif ( ! in_array( $license_url, $restrictive_licenses, true ) ) {
				return true; // Anyone can clone local books that aren't restrictively licensed
			} else {
				return false;
			}
		} elseif ( in_array( $license_url, $restrictive_licenses, true ) ) {
			return false; // No one can clone global books that are restrictively licensed
		}
		return true;
	}
public function isSourceCloneable ( $ metadata_license ) { $ restrictive_licenses = [ 'https://creativecommons.org/licenses/by-nd/4.0/' , 'https://creativecommons.org/licenses/by-nc-nd/4.0/' , 'https://choosealicense.com/no-license/' , ] ; if ( is_array ( $ metadata_license ) ) { $ license_url = $ metadata_license [ 'url' ] ; } else { // Backwards compatibility. $ license_url = $ metadata_license ; } $ license_url = trailingslashit ( trim ( $ license_url ) ) ; if ( ! empty ( $ this -> sourceBookId ) ) { if ( $ this -> isSuperAdmin ) { return true ; // Network administrators can clone local books no matter how they're licensed } elseif ( ! in_array ( $ license_url , $ restrictive_licenses , true ) ) { return true ; // Anyone can clone local books that aren't restrictively licensed } else { return false ; } } elseif ( in_array ( $ license_url , $ restrictive_licenses , true ) ) { return false ; // No one can clone global books that are restrictively licensed } return true ; }
Is the source book cloneable?

@since 4.1.0

@param mixed $metadata_license

@return bool Whether or not the book is public and licensed for cloning (or true if the current user is a network administrator and the book is in the current network).
Is the source book cloneable?