parsely = $parsely; } /** * Starts up the class and enqueues necessary actions. * * @since 3.2.0 */ abstract public function run(): void; /** * Registers the metadata fields on the appropriate resource types. * * @since 3.2.0 */ abstract public function register_meta(): void; /** * Returns the metadata in string format. * * @since 3.2.0 * * @param string $meta_type `json_ld` or `repeated_metas`. * @return string The metadata as HTML code. */ public function get_rendered_meta( string $meta_type ): string { $metadata_renderer = new Metadata_Renderer( $this->parsely ); ob_start(); $metadata_renderer->render_metadata( $meta_type ); $out = ob_get_clean(); if ( false === $out ) { return ''; } return trim( $out ); } }