Adopt reusable CI standard + PHPUnit conversion (#22)
Squash-merge of PR #22: adopt shared reusable CI workflow, convert PHPUnit to stubs, update branch-protection contexts.
QA-approved at 05d8094a1d. All required CI checks green.
Agent-Session: 2026-06-17-prcore-ci-deploy
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Related Posts Section.
|
||||
*
|
||||
* @package Peptide_Repo_Core
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Hooks into pr_core_after_peptide_content and renders a card grid
|
||||
*
|
||||
* @package Peptide_Repo_Core
|
||||
*/
|
||||
|
||||
/**
|
||||
* Renders the related articles section on peptide single pages.
|
||||
*
|
||||
@@ -15,7 +27,11 @@ declare(strict_types=1);
|
||||
*/
|
||||
class PR_Core_Related_Posts_Section {
|
||||
|
||||
/** @var PR_Core_Related_Posts_Provider */
|
||||
/**
|
||||
* PR_Core_Related_Posts_Provider.
|
||||
*
|
||||
* @var PR_Core_Related_Posts_Provider
|
||||
*/
|
||||
private $provider;
|
||||
|
||||
/**
|
||||
@@ -33,8 +49,8 @@ class PR_Core_Related_Posts_Section {
|
||||
* @return void
|
||||
*/
|
||||
public function register_hooks(): void {
|
||||
add_action( 'pr_core_after_peptide_content', [ $this, 'render' ] );
|
||||
add_action( 'save_post_post', [ $this, 'invalidate_caches' ] );
|
||||
add_action( 'pr_core_after_peptide_content', array( $this, 'render' ) );
|
||||
add_action( 'save_post_post', array( $this, 'invalidate_caches' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +88,7 @@ class PR_Core_Related_Posts_Section {
|
||||
break;
|
||||
}
|
||||
setup_postdata( $post );
|
||||
get_template_part( 'template-parts/related-posts/card', null, [ 'post' => $post ] );
|
||||
get_template_part( 'template-parts/related-posts/card', null, array( 'post' => $post ) );
|
||||
++$count;
|
||||
}
|
||||
wp_reset_postdata();
|
||||
@@ -90,6 +106,7 @@ class PR_Core_Related_Posts_Section {
|
||||
<?php
|
||||
echo wp_kses_post(
|
||||
sprintf(
|
||||
// translators: %s: peptide display name.
|
||||
__( 'View all %s articles →', 'peptide-repo-core' ),
|
||||
esc_html( $peptide->post_title )
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user