esc_url_raw( rest_url( 'pds/v1/' ) ), 'siteName' => get_bloginfo( 'name' ), ] ); } // ------------------------------------------------------------------------- // Body class // ------------------------------------------------------------------------- public function tag_reader_body( array $classes ): array { $row = Prweb_Reader_Sessions::verify( Prweb_Reader_Sessions::cookie_value() ); $classes[] = $row ? 'webapp-reader-licensed' : 'webapp-reader-unlicensed'; return $classes; } // ------------------------------------------------------------------------- // Content gate // ------------------------------------------------------------------------- /** * Soft-gate the content of single posts. Unlicensed readers see only the * first ~60 words plus a placeholder the JS replaces with a Register CTA. * The home page, archives, RSS feeds, and the WP REST API are unaffected * so the validator's /assets proxy can still see the full content. */ public function gate_post_content( string $content ): string { if ( is_admin() || ! is_singular( 'post' ) || is_feed() ) { return $content; } if ( Prweb_Reader_Sessions::verify( Prweb_Reader_Sessions::cookie_value() ) ) { return $content; } $excerpt = wp_trim_words( wp_strip_all_tags( $content ), 60, '…' ); $cta_id = 'webapp-gate-' . get_the_ID(); return sprintf( '

%s

' . '
', esc_html( $excerpt ), esc_attr( $cta_id ) ); } // ------------------------------------------------------------------------- // Reader chrome // ------------------------------------------------------------------------- public function render_reader_chrome(): void { if ( is_admin() ) { return; } ?>
This site's content is licensed via OpenRSL.

Register to view this site

The publisher has licensed this site's content through PDS · OpenRSL. Click Accept to provision an on-chain reader identity and a single-use ACCESS license. Email is optional — only the publisher sees it.