public function h5p( $content ) {
		$known_h5p = $this->cloner->getKnownH5P();
		$new_h5p_ids = [];
		$h5p_ids = $this->h5p->findAllShortcodeIds( $content );
		foreach ( $h5p_ids as $h5p_id ) {
			if ( ! isset( $this->H5PWasAlreadyDownloaded[ $h5p_id ] ) ) {
				foreach ( $known_h5p as $h5p ) {
					if ( absint( $h5p->id ) === absint( $h5p_id ) ) {
						$new_h5p_id = $this->h5p->fetch( $h5p->url );
						if ( $new_h5p_id ) {
							$new_h5p_ids[] = $new_h5p_id;
							$this->cloner->createTransition( 'h5p', $h5p_id, $new_h5p_id );
							$this->H5PWasAlreadyDownloaded[ $h5p_id ] = $new_h5p_id;
						} else {
							// An id of 0 means there was a problem. We have to replace the broken H5P shortcode with a warning
							$new_h5p_ids[] = "#fixme{$h5p->id}";
						}
						continue 2;
					}
				}
			}
		}
		return $new_h5p_ids;
	}
public function h5p( $content ) {
		$known_h5p = $this->cloner->getKnownH5P();
		$new_h5p_ids = [];
		$h5p_ids = $this->h5p->findAllShortcodeIds( $content );
		foreach ( $h5p_ids as $h5p_id ) {
			if ( ! isset( $this->H5PWasAlreadyDownloaded[ $h5p_id ] ) ) {
				foreach ( $known_h5p as $h5p ) {
					if ( absint( $h5p->id ) === absint( $h5p_id ) ) {
						$new_h5p_id = $this->h5p->fetch( $h5p->url );
						if ( $new_h5p_id ) {
							$new_h5p_ids[] = $new_h5p_id;
							$this->cloner->createTransition( 'h5p', $h5p_id, $new_h5p_id );
							$this->H5PWasAlreadyDownloaded[ $h5p_id ] = $new_h5p_id;
						} else {
							// An id of 0 means there was a problem. We have to replace the broken H5P shortcode with a warning
							$new_h5p_ids[] = "#fixme{$h5p->id}";
						}
						continue 2;
					}
				}
			}
		}
		return $new_h5p_ids;
	}
public function h5p ( $ content ) { $ known_h5p = $ this -> cloner -> getKnownH5P ( ) ; $ new_h5p_ids = [ ] ; $ h5p_ids = $ this -> h5p -> findAllShortcodeIds ( $ content ) ; foreach ( $ h5p_ids as $ h5p_id ) { if ( ! isset ( $ this -> H5PWasAlreadyDownloaded [ $ h5p_id ] ) ) { foreach ( $ known_h5p as $ h5p ) { if ( absint ( $ h5p -> id ) === absint ( $ h5p_id ) ) { $ new_h5p_id = $ this -> h5p -> fetch ( $ h5p -> url ) ; if ( $ new_h5p_id ) { $ new_h5p_ids [ ] = $ new_h5p_id ; $ this -> cloner -> createTransition ( 'h5p' , $ h5p_id , $ new_h5p_id ) ; $ this -> H5PWasAlreadyDownloaded [ $ h5p_id ] = $ new_h5p_id ; } else { // An id of 0 means there was a problem. We have to replace the broken H5P shortcode with a warning $ new_h5p_ids [ ] = "#fixme{$h5p->id}" ; } continue 2 ; } } } } return $ new_h5p_ids ; }
Parse HTML snippet, download all found H5P, save transition states to change shortcodes in post processing step

@param string $content

@see \Pressbooks\Cloner\Cloner::$knownH5P

@return array
Parse HTML snippet download all found H5P save transition states to change shortcodes in post processing step