🎨 Simplify the default Composers (#3250)

This commit is contained in:
Brandon
2025-03-26 21:24:04 -05:00
committed by GitHub
parent 3d87ce1f6a
commit 5ffb5636b2
6 changed files with 20 additions and 80 deletions

View File

@@ -17,25 +17,10 @@ class Post extends Composer
'partials.content-*',
];
/**
* Data to be passed to view before rendering, but after merging.
*
* @return array
*/
public function override()
{
return [
'title' => $this->title(),
'pagination' => $this->pagination(),
];
}
/**
* Retrieve the post title.
*
* @return string
*/
public function title()
public function title(): string
{
if ($this->view->name() !== 'partials.page-header') {
return get_the_title();
@@ -70,10 +55,8 @@ class Post extends Composer
/**
* Retrieve the pagination links.
*
* @return string
*/
public function pagination()
public function pagination(): string
{
return wp_link_pages([
'echo' => 0,