Restyle a guest’s publications, or change or remove the affiliate line
A guest’s publications (books, articles, papers and others, entered on the guest editor) are drawn on their guest page after the website and social links, and in the [benecaster_guest] card when it says publications="true" (off by default). Both draw guest/publications.php, which a theme overrides at {theme}/benecaster/guest/publications.php.
- The template’s variables:
$guest_id;$publications, in the podcaster’s order, each{ title, url, rel, affiliate, type, year, details }:urlis the address to link to (the Outlinks/go/address while the publication is tracked and Outlinks is running, else the plain address,''for no link);relissponsored nofollow noopenerfor an affiliate link andnoopener noreferrerotherwise;typeisbook,article,paperorother;yearfour digits or'';detailsthe translated type and the year (Book, 2024);$disclosure, the line under the list,''for none;$context,pageorcard. Values are raw: escape them. - Markup:
section.benecaster-guest-publications(--pageor--card), a heading (h2on the page,pin the card) Publications,ul.benecaster-guest-publications__listofli.__itemholdinga.__title(orspan.__titlewith no link) andspan.__details, thenp.__disclosure. - A theme that overrides
guest/profile.phpdraws them only if it loads the part itself, as the add-on’s ownprofile.phpdoes after the links:benecaster_get_template_part( 'guest/publications', [ 'guest_id' => $guest_id, 'publications' => $page['publications'], 'disclosure' => $page['publications_disclosure'], 'context' => 'page' ] ). - The guest page’s data filter, benecaster_guest_manager_guest_page_data, carries
publications; the disclosure is worked out after it from the publications it leaves. - benecaster_guest_manager_affiliate_disclosure
( string $text, int $guest_id )changes the line Some of these links are affiliate links.; return''to show none.
Code
<?php
add_filter( 'benecaster_guest_manager_affiliate_disclosure', static function ( string $text, int $guest_id ): string {
return __( 'We may earn a commission from links marked as affiliate links.', 'my-theme' );
}, 10, 2 );
Hooks Used
Need this built rather than just documented? See our services →